.travis.yml 10 KB

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