cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
.ci/scripts/component-tests.sh
25lines · modecode
| 1 | #!/bin/bash |
| 2 | set -e -o pipefail |
| 3 | |
| 4 | # Fetch cloudflared from the artifacts folder |
| 5 | mv ./artifacts/cloudflared ./cloudflared |
| 6 | |
| 7 | python3 -m venv env |
| 8 | . env/bin/activate |
| 9 | |
| 10 | pip install --upgrade -r component-tests/requirements.txt |
| 11 | |
| 12 | # Creates and routes a Named Tunnel for this build. Also constructs |
| 13 | # config file from env vars. |
| 14 | python3 component-tests/setup.py --type create |
| 15 | |
| 16 | # Define the cleanup function |
| 17 | cleanup() { |
| 18 | # The Named Tunnel is deleted and its route unprovisioned here. |
| 19 | python3 component-tests/setup.py --type cleanup |
| 20 | } |
| 21 | |
| 22 | # The trap will call the cleanup function on script exit |
| 23 | trap cleanup EXIT |
| 24 | |
| 25 | pytest component-tests -o log_cli=true --log-cli-level=INFO --junit-xml=report.xml |
| 26 | |