Browse Source

Travis: do networks in separate builds, and features in script steps

We can't use Linux for IPv6 networks, because Travis Linux does not
support IPv6.

Temporarily disable some unreliable feature tests, until we fix some
bugs.

Part of 30066.
teor 5 years ago
parent
commit
3d3ba34217
1 changed files with 50 additions and 11 deletions
  1. 50 11
      .travis.yml

+ 50 - 11
.travis.yml

@@ -6,23 +6,45 @@ python: "2.7"
 
 os:
   - linux
-  ## We add a single macOS build below
+  ## We also use macOS for some networks
 
 matrix:
   # include creates Linux, python 2.7, tor stable builds by default
   # the key(s) in each item override these defaults
   include:
-    ## Test macOS with its default python version, which is currently 2.7.
-    ## (But we don't show the version, because Travis might change it without
-    ## us noticing.)
-    ## Use language: c to work around an issue with language: python on macOS.
-    ## We get the tor version in the homebrew cache on the macOS image
-    ## The current tor version in homebrew is on this page:
-    ## https://formulae.brew.sh/formula/tor
-    - os: osx
+    ## Test different network flavours
+    ## We're using the 0.2.9 networks from tor's "make test-network-all"
+    ##
+    ## We need to use macOS to test IPv6 networks, because Travis Linux doesn't
+    ## support IPv6. But macOS is tricky:
+    ##   - We use the default python version on macOS, which is currently 2.7.
+    ##     (But we don't show the version, because Travis might change it
+    ##     without us noticing.)
+    ##   - We use language: c, because language: python fails on Travis macOS.
+    ##   - We get the tor version in the homebrew cache on the macOS image.
+    ##     The latest tor version in homebrew is on this page:
+    ##       https://formulae.brew.sh/formula/tor
+    ##     The Travis version might be slightly older.
+    - env: NETWORK_FLAVOUR="basic-min"
+    - env: NETWORK_FLAVOUR="bridges-min"
+    - env: NETWORK_FLAVOUR="hs-min"
+    - env: NETWORK_FLAVOUR="single-onion"
+    - env: NETWORK_FLAVOUR="bridges+ipv6-min"
+      os: osx
       language: c
       python:
-      env: TOR="stable-release"
+    ## The IPv6 exit test doesn't actually require IPv6, see #30182.
+    ## But we'll keep this test, because it does test IPv6 exit config.
+    - env: NETWORK_FLAVOUR="ipv6-exit-min"
+    - env: NETWORK_FLAVOUR="hs-ipv6"
+      os: osx
+      language: c
+      python:
+    - env: NETWORK_FLAVOUR="single-onion-ipv6"
+      os: osx
+      language: c
+      python:
+
     ## Test all supported and available tor versions on Linux
     ## If the deb.torproject.org repositories are removed, we will fall back to
     ## Ubuntu security's tor version (currently 0.2.9.14). We might want to
@@ -77,6 +99,7 @@ matrix:
             - shellcheck
             - tor
       env: TOR="master-nightly"
+
     ## Test all supported python releases
     ## Pre-installed in Travis xenial:
     ## https://docs.travis-ci.com/user/reference/xenial/#python-support
@@ -171,9 +194,23 @@ install:
   - tor --version
 
 script:
+  ## Basic tests
   - tests/shellcheck-tests.sh
   - tests/unit-tests.sh
-  - tools/test-network.sh --allow-failures 1
+  ## Quick smoke test
+  - tools/test-network.sh --dry-run
+  ## Now, allow one failure for each test (--allow-failures 1)
+  - export CHUTNEY_ALLOW_FAILURES=1
+  ## Different data directory
+  - tools/test-network.sh --net-dir "$(mktemp -d)"
+  ## IP address handling
+  - tools/test-network.sh --ipv4 "127.0.0.1" --ipv6 "[::1]"
+  ## Offline mode
+  - tools/test-network.sh --offline
+  ## --data fails on python3, and on some tor versions
+  ## We'll fix this issue in #30071
+  #- FIVE_MEGABYTES=$((5*1024*1024))
+  #- tools/test-network.sh --data "$FIVE_MEGABYTES" --connections 2 --rounds 2 --hs-multi-client 1 --start-time 130 --bootstrap-time 70 --stop-time 10
 
 after_failure:
   ## List the contents of net/nodes
@@ -191,6 +228,8 @@ after_failure:
   #- cat net/nodes/00*a*/state
   - for f in net/nodes/00*a*/v3-status-votes ; do echo "$f"; cat "$f"; done
   - for f in net/nodes/00*a*/unparseable-descs/* ; do echo "$f"; cat "$f"; done
+  ## And repeat the warnings at the end
+  - tools/test-network.sh --only-warnings
 
 notifications:
   irc: