.travis.yml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. language: python
  2. # The default python version on Travis is 2.7
  3. # But we add this line to show the python version in the Travis UI
  4. python: "2.7"
  5. os:
  6. - linux
  7. ## We also use macOS for some networks
  8. ## We don't use the build matrix cross-product, because it makes too many jobs
  9. ## Instead, we list each job under matrix: include:
  10. env:
  11. global:
  12. ## Turn off tor's sandbox in chutney, until we fix sandbox errors that are
  13. ## triggered by Ubuntu Xenial and Bionic. See #32722.
  14. - CHUTNEY_TOR_SANDBOX="0"
  15. matrix:
  16. ## This matrix entry is required, but it doesn't actually create any jobs
  17. ## by itself. All jobs are created by matrix: include: entries
  18. ##
  19. ## The TOR env var should be kept in sync with the Linux tor version in
  20. ## the addons section below
  21. ## We use the basic-min network by default, to reduce load and increase
  22. ## reliability
  23. - TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  24. matrix:
  25. # include creates Linux, python 2.7, tor master builds by default
  26. # we use tor master to catch tor issues before stable releases
  27. # the key(s) in each item override these defaults
  28. include:
  29. ## Test different network flavours
  30. ## We're using the networks from tor master's "make test-network-all"
  31. ##
  32. ## We need to use macOS to test IPv6 networks, because Travis Linux doesn't
  33. ## support IPv6. But macOS is tricky:
  34. ## - We use the default python version on macOS, which is currently 2.7.
  35. ## (But we don't show the version, because Travis might change it
  36. ## without us noticing.)
  37. ## - We use language: c, because language: python fails on Travis macOS.
  38. ## - We get the tor version in the homebrew cache on the macOS image.
  39. ## The latest tor version in homebrew is on this page:
  40. ## https://formulae.brew.sh/formula/tor
  41. ## The Travis version might be slightly older.
  42. - env: TOR="master-nightly" NETWORK_FLAVOUR="bridges-min"
  43. - env: TOR="master-nightly" NETWORK_FLAVOUR="hs-v2-min"
  44. - env: TOR="master-nightly" NETWORK_FLAVOUR="hs-v3-min"
  45. - env: TOR="master-nightly" NETWORK_FLAVOUR="single-onion-v23"
  46. - env: TOR="stable-release" NETWORK_FLAVOUR="bridges+ipv6-min"
  47. os: osx
  48. language: c
  49. python:
  50. ## The IPv6 exit test doesn't actually require IPv6, see #30182.
  51. ## But we'll keep this test, because it does test IPv6 exit config.
  52. - env: TOR="master-nightly" NETWORK_FLAVOUR="ipv6-exit-min"
  53. - env: TOR="stable-release" NETWORK_FLAVOUR="hs-v23-ipv6-md"
  54. os: osx
  55. language: c
  56. python:
  57. ## v3 onion service IPv6 tests
  58. - env: TOR="stable-release" NETWORK_FLAVOUR="single-onion-v23-ipv6-md"
  59. os: osx
  60. language: c
  61. python:
  62. ## Test all supported and available tor versions on Linux
  63. ## If the deb.torproject.org repositories are removed, we will fall back to
  64. ## Ubuntu security's tor version (currently 0.2.9.14). We might want to
  65. ## automatically fail the job if we can't get a newer tor, see #29741.
  66. ## The current tor versions in Ubuntu are on this page:
  67. ## https://packages.ubuntu.com/search?keywords=tor&searchon=names&exact=1
  68. - addons:
  69. apt:
  70. sources:
  71. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.2.9.x-bionic main'
  72. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  73. packages:
  74. - shellcheck
  75. - tor
  76. env: TOR="0.2.9-nightly" NETWORK_FLAVOUR="basic-min"
  77. - addons:
  78. apt:
  79. sources:
  80. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.3.5.x-bionic main'
  81. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  82. packages:
  83. - shellcheck
  84. - tor
  85. env: TOR="0.3.5-nightly" NETWORK_FLAVOUR="basic-min"
  86. - addons:
  87. apt:
  88. sources:
  89. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.0.x-bionic main'
  90. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  91. packages:
  92. - shellcheck
  93. - tor
  94. env: TOR="0.4.0-nightly" NETWORK_FLAVOUR="basic-min"
  95. ## The current stable release is 0.4.1
  96. - addons:
  97. apt:
  98. sources:
  99. - sourceline: 'deb https://deb.torproject.org/torproject.org bionic main'
  100. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  101. packages:
  102. - shellcheck
  103. - tor
  104. env: TOR="stable-release" NETWORK_FLAVOUR="basic-min"
  105. ## We also have 0.4.1 and 0.4.2 nightlies
  106. - addons:
  107. apt:
  108. sources:
  109. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.1.x-bionic main'
  110. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  111. packages:
  112. - shellcheck
  113. - tor
  114. env: TOR="0.4.1-nightly" NETWORK_FLAVOUR="basic-min"
  115. - addons:
  116. apt:
  117. sources:
  118. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.2.x-bionic main'
  119. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  120. packages:
  121. - shellcheck
  122. - tor
  123. env: TOR="0.4.2-nightly" NETWORK_FLAVOUR="basic-min"
  124. ## Test all supported python releases
  125. ## Pre-installed in macOS
  126. - os: osx
  127. language: c
  128. python:
  129. ## python 3 is already installed, under this name
  130. env: PYTHON="python3" TOR="stable-release"
  131. ## Pre-installed in Travis Bionic:
  132. ## https://docs.travis-ci.com/user/reference/bionic/#python-support
  133. ## End of Life: 1 January 2020
  134. ## https://www.python.org/dev/peps/pep-0373/#update
  135. - python: "2.7"
  136. ## End of Life: December 2021
  137. ## https://www.python.org/dev/peps/pep-0494/#lifespan
  138. - python: "3.6"
  139. ## End of Life: June 2023
  140. ## https://www.python.org/dev/peps/pep-0537/#lifespan
  141. - python: "3.7"
  142. ## Extra Installs
  143. ## End of Life: October 2024
  144. ## https://www.python.org/dev/peps/pep-0569/#lifespan
  145. - python: "3.8"
  146. ## Python 3.9
  147. ## Travis Dev Package: ????
  148. ## (Add 3.9-dev)
  149. ## Stable: 10 October 2020
  150. ## (Switch from 3.9-dev to 3.9, and check for {3.10,4.0}-dev)
  151. ## End of Life: October 2025
  152. ## https://www.python.org/dev/peps/pep-0596/#lifespan
  153. #- python: "3.9-dev"
  154. - python: "nightly"
  155. ## PyPy versions
  156. ## PyPy isn't packaged for Travis Bionic yet
  157. ## Pypy 2
  158. ## End of Life: "forever"
  159. ## http://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-support-python2
  160. ## But chutney can decide not to support python 2 after 1 Jan 2020.
  161. - python: "pypy"
  162. dist: xenial
  163. addons:
  164. apt:
  165. sources:
  166. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-master-xenial main'
  167. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  168. packages:
  169. - shellcheck
  170. - tor
  171. ## PyPy does not have documented end of life dates
  172. - python: "pypy3"
  173. dist: xenial
  174. addons:
  175. apt:
  176. sources:
  177. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-master-xenial main'
  178. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  179. packages:
  180. - shellcheck
  181. - tor
  182. ## Uncomment to allow the build to report success (with non-required
  183. ## sub-builds continuing to run) if all required sub-builds have
  184. ## succeeded. This is somewhat buggy currently: it can cause
  185. ## duplicate notifications and prematurely report success if a
  186. ## single sub-build has succeeded. See
  187. ## https://github.com/travis-ci/travis-ci/issues/1696
  188. #fast_finish: true
  189. ## These builds fail in Travis at the moment
  190. #allow_failures:
  191. # - env: TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  192. ## (Linux only) Use the Ubuntu Bionic Linux Image
  193. dist: bionic
  194. ## (macOS only) Use a recent macOS image
  195. ## See https://docs.travis-ci.com/user/reference/osx#os-x-version
  196. ## Default is Xcode 9.4 on macOS 10.13 as of October 2019
  197. ## Recent is Xcode 11.2 on macOS 10.14 as of October 2019
  198. osx_image: xcode11.2
  199. ## Download our dependencies
  200. addons:
  201. ## (Linux only)
  202. apt:
  203. sources:
  204. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-master-bionic main'
  205. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  206. packages:
  207. - shellcheck
  208. - tor
  209. ## (macOS only)
  210. homebrew:
  211. packages:
  212. - shellcheck
  213. - tor
  214. # See ticket #30928 for more information. This key should be removed at
  215. # some point to speed up builds.
  216. update: true
  217. before_install:
  218. ## Set pipefail: we may use pipes in future
  219. - set -o pipefail || echo "pipefail failed"
  220. install:
  221. ## Chutney has no dependencies, apart from tor
  222. ## List installed package versions
  223. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi
  224. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi
  225. ## Use the default spelling for python, unless it is overridden
  226. - export PYTHON=${PYTHON:-python}
  227. - $PYTHON --version
  228. - if command -v shellcheck ; then shellcheck --version; fi
  229. - tor --version
  230. ## List the permissions on chutney and chutney/net
  231. - ls -al . net
  232. script:
  233. ## Basic tests
  234. - if command -v shellcheck ; then tests/shellcheck-tests.sh; fi
  235. - tests/unit-tests.sh
  236. ## Quick smoke test
  237. - tools/test-network.sh --dry-run
  238. ## Now, allow one failure for each test (--allow-failures 1)
  239. - export CHUTNEY_ALLOW_FAILURES=1
  240. ## Different data directory
  241. - tools/test-network.sh --net-dir "$(mktemp -d)"
  242. ## IP address handling
  243. - tools/test-network.sh --ipv4 "127.0.0.1" --ipv6 "[::1]"
  244. ## Offline mode
  245. - tools/test-network.sh --offline
  246. ## --data fails on python3, and on some tor versions
  247. ## We'll fix this issue in #30071
  248. #- FIVE_MEGABYTES=$((5*1024*1024))
  249. #- tools/test-network.sh --data "$FIVE_MEGABYTES" --connections 2 --rounds 2 --hs-multi-client 1 --start-time 130 --bootstrap-time 70 --stop-time 10
  250. after_failure:
  251. ## List the permissions on chutney and chutney/net
  252. - ls -al . net
  253. ## List the contents of net/nodes
  254. - ls -lR net/nodes/
  255. ## Dump the important directory documents
  256. #- cat net/nodes/000a*/cached-certs
  257. - cat net/nodes/000a*/cached-consensus
  258. - cat net/nodes/000a*/cached-descriptors*
  259. #- cat net/nodes/000a*/cached-extrainfo*
  260. - cat net/nodes/000a*/cached-microdesc-consensus
  261. - cat net/nodes/000a*/cached-microdescs*
  262. #- cat net/nodes/000a*/key-pinning-journal
  263. #- cat net/nodes/000a*/router-stability
  264. #- cat net/nodes/00*a*/sr-state
  265. #- cat net/nodes/00*a*/state
  266. - for f in net/nodes/00*a*/v3-status-votes ; do echo "$f"; cat "$f"; done
  267. - for f in net/nodes/00*a*/unparseable-descs/* ; do echo "$f"; cat "$f"; done
  268. ## And repeat the warnings at the end
  269. - tools/test-network.sh --only-warnings
  270. notifications:
  271. irc:
  272. channels:
  273. - "irc.oftc.net#tor-ci"
  274. template:
  275. - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
  276. - "Build #%{build_number} %{result}. Details: %{build_url}"
  277. on_success: change
  278. on_failure: change
  279. email:
  280. on_success: never
  281. on_failure: change