.travis.yml 9.7 KB

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