.travis.yml 8.5 KB

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