.travis.yml 8.8 KB

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