.travis.yml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. ## The current stable release is 0.4.0
  71. - addons:
  72. apt:
  73. sources:
  74. - sourceline: 'deb https://deb.torproject.org/torproject.org xenial main'
  75. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  76. packages:
  77. - shellcheck
  78. - tor
  79. env: TOR="stable-release" NETWORK_FLAVOUR="basic-min"
  80. ## We also have 0.4.0 and 0.4.1 nightlies
  81. - addons:
  82. apt:
  83. sources:
  84. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-0.4.0.x-xenial main'
  85. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  86. packages:
  87. - shellcheck
  88. - tor
  89. env: TOR="0.4.0-nightly" NETWORK_FLAVOUR="basic-min"
  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. ## Test all supported python releases
  100. ## Pre-installed in Travis xenial:
  101. ## https://docs.travis-ci.com/user/reference/xenial/#python-support
  102. ## End of Life: 1 January 2020
  103. ## https://www.python.org/dev/peps/pep-0373/#id2
  104. - python: "2.7"
  105. ## End of Life: December 2021
  106. ## https://www.python.org/dev/peps/pep-0494/#lifespan
  107. - python: "3.6"
  108. ## End of Life: June 2023
  109. ## https://www.python.org/dev/peps/pep-0537/#lifespan
  110. - python: "3.7"
  111. ## Stable: 20 October 2019
  112. ## (Switch from 3.8-dev to 3.8, and check for 3.9-dev)
  113. ## End of Life: October 2024
  114. ## https://www.python.org/dev/peps/pep-0569/#lifespan
  115. - python: "3.8-dev"
  116. - python: "nightly"
  117. # PyPy versions
  118. ## End of Life: "forever"
  119. ## http://doc.pypy.org/en/latest/faq.html#how-long-will-pypy-support-python2
  120. ## But chutney can decide not to support python 2 after 1 Jan 2020.
  121. ## Travis Xenial does not support pypy2.7
  122. #- python: "pypy2.7"
  123. ## PyPy does not have documented end of life dates
  124. - python: "pypy3.5"
  125. ## PyPy 3.6 is currently in alpha
  126. ## Travis Xenial does not support pypy3.6-dev yet?
  127. #- python: "pypy3.6-dev"
  128. ## Uncomment to allow the build to report success (with non-required
  129. ## sub-builds continuing to run) if all required sub-builds have
  130. ## succeeded. This is somewhat buggy currently: it can cause
  131. ## duplicate notifications and prematurely report success if a
  132. ## single sub-build has succeeded. See
  133. ## https://github.com/travis-ci/travis-ci/issues/1696
  134. #fast_finish: true
  135. ## These builds fail in Travis at the moment
  136. #allow_failures:
  137. # - env: TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  138. ## We don't need sudo. (The "apt:" stanza after this allows us to not need
  139. ## sudo; otherwise, we would need it for getting dependencies.)
  140. sudo: false
  141. ## (Linux only) Use the Ubuntu Xenial Linux Image
  142. ## deb.torproject.org doesn't support Trusty any more
  143. dist: xenial
  144. ## (OSX only) Use the default OSX image
  145. ## See https://docs.travis-ci.com/user/reference/osx#os-x-version
  146. ## Default is Xcode 9.4 on macOS 10.13 as of August 2018
  147. #osx_image: xcode9.4
  148. ## The TOR env var should be kept in sync with the Linux tor version below
  149. ## We use the basic-min network by default, to reduce load and increase
  150. ## reliability
  151. env:
  152. - TOR="master-nightly" NETWORK_FLAVOUR="basic-min"
  153. ## Download our dependencies
  154. addons:
  155. ## (Linux only)
  156. apt:
  157. sources:
  158. - sourceline: 'deb https://deb.torproject.org/torproject.org tor-nightly-master-xenial main'
  159. key_url: 'https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc'
  160. packages:
  161. - shellcheck
  162. - tor
  163. ## (macOS only)
  164. homebrew:
  165. packages:
  166. - shellcheck
  167. - tor
  168. # See ticket #30928 for more information. This key should be removed at
  169. # some point to speed up builds.
  170. update: true
  171. install:
  172. ## Chutney has no dependencies, apart from tor
  173. ## List installed package versions
  174. - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then dpkg-query --show; fi
  175. - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew list --versions; fi
  176. - python --version
  177. - if command -v shellcheck ; then shellcheck --version; fi
  178. - tor --version
  179. script:
  180. ## Basic tests
  181. - if command -v shellcheck ; then tests/shellcheck-tests.sh; fi
  182. - tests/unit-tests.sh
  183. ## Quick smoke test
  184. - tools/test-network.sh --dry-run
  185. ## Now, allow one failure for each test (--allow-failures 1)
  186. - export CHUTNEY_ALLOW_FAILURES=1
  187. ## Different data directory
  188. - tools/test-network.sh --net-dir "$(mktemp -d)"
  189. ## IP address handling
  190. - tools/test-network.sh --ipv4 "127.0.0.1" --ipv6 "[::1]"
  191. ## Offline mode
  192. - tools/test-network.sh --offline
  193. ## --data fails on python3, and on some tor versions
  194. ## We'll fix this issue in #30071
  195. #- FIVE_MEGABYTES=$((5*1024*1024))
  196. #- tools/test-network.sh --data "$FIVE_MEGABYTES" --connections 2 --rounds 2 --hs-multi-client 1 --start-time 130 --bootstrap-time 70 --stop-time 10
  197. after_failure:
  198. ## List the contents of net/nodes
  199. - ls -lR net/nodes/
  200. ## Dump the important directory documents
  201. #- cat net/nodes/000a*/cached-certs
  202. - cat net/nodes/000a*/cached-consensus
  203. - cat net/nodes/000a*/cached-descriptors*
  204. #- cat net/nodes/000a*/cached-extrainfo*
  205. - cat net/nodes/000a*/cached-microdesc-consensus
  206. - cat net/nodes/000a*/cached-microdescs*
  207. #- cat net/nodes/000a*/key-pinning-journal
  208. #- cat net/nodes/000a*/router-stability
  209. #- cat net/nodes/00*a*/sr-state
  210. #- cat net/nodes/00*a*/state
  211. - for f in net/nodes/00*a*/v3-status-votes ; do echo "$f"; cat "$f"; done
  212. - for f in net/nodes/00*a*/unparseable-descs/* ; do echo "$f"; cat "$f"; done
  213. ## And repeat the warnings at the end
  214. - tools/test-network.sh --only-warnings
  215. notifications:
  216. irc:
  217. channels:
  218. - "irc.oftc.net#tor-ci"
  219. template:
  220. - "%{repository} %{branch} %{commit} - %{author}: %{commit_subject}"
  221. - "Build #%{build_number} %{result}. Details: %{build_url}"
  222. on_success: change
  223. on_failure: change
  224. email:
  225. on_success: never
  226. on_failure: change