Skip to content

Commit

Permalink
ci: add run for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Jun 10, 2022
1 parent 901bff8 commit 03e5078
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
29 changes: 26 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,19 @@ workflows:
- lint:
requires:
- prepare-tidy
- build-test-linux:
- build-test-linux-test-go:
requires:
- prepare-tidy
- build-test-linux-k8s:
requires:
- prepare-tidy
- build-test-linux-docker:
requires:
- prepare-tidy
- build-test-linux-local:
requires:
- prepare-tidy
- build-test-linux-examples:
requires:
- prepare-tidy
- build-macos:
Expand Down Expand Up @@ -150,8 +162,8 @@ jobs:
name: "build testground"
command: make install
- run:
name: "run cluster:k8s integration tests"
command: make test-integ-cluster-k8s
name: "run local:docker integration tests"
command: make test-integ-local-docker

build-test-linux-local:
executor: linux
Expand All @@ -164,6 +176,17 @@ jobs:
name: "run local:exec integration tests"
command: make test-integ-local-exec

build-test-linux-examples:
executor: linux
steps:
- setup-install-bins
- run:
name: "build testground"
command: make install
- run:
name: "run examples integration tests"
command: make test-integ-examples

build-macos:
macos:
xcode: 13.2.0
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ test-integ-local-docker:
test-integ-local-exec:
./integration_tests/03_exec_go_placebo_ok.sh

test-integ-examples:
./integration_tests/example_01_rust.sh

kind-cluster:
kind create cluster --wait 90s
kubectl apply -f .circleci/pv.yaml
Expand Down
22 changes: 22 additions & 0 deletions integration_tests/example_01_rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

source "${__dir}/header.sh"

testground plan import --from ./plans --name testground

pushd $TEMPDIR

testground healthcheck --runner local:docker --fix

testground run single \
--plan=testground/example-rust \
--testcase=tcp-connect \
--builder=docker:generic \
--runner=local:docker \
--instances=2 \
--wait

echo "terminating remaining containers"
testground terminate --runner local:docker
4 changes: 2 additions & 2 deletions integration_tests/header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ DAEMONPID=$!

sleep 2

echo "Waiting for Testground to launch on 8080..."
while ! nc -z localhost 8080; do
echo "Waiting for Testground to launch on 8040..."
while ! nc -z localhost 8040; do
sleep 1
done
echo "Testground launched"

0 comments on commit 03e5078

Please sign in to comment.