.travis.yml 9.1 KB

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