Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run the quicker quickstart before fablab #1299

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ jobs:
name: Fablab Smoketest
# not applicable to forks. shouldn't run on release build
if: github.repository_owner == 'openziti' && github.ref != 'refs/heads/main'
needs: [ quickstart ]
runs-on: ubuntu-20.04
steps:
- name: Git Checkout
Expand Down Expand Up @@ -232,6 +233,30 @@ jobs:
echo "WARN: No instance archive found for simple-transfer-${GITHUB_RUN_NUMBER}.tar.gz.gpg" >&2
fi

quickstart:
name: Run the Go Quickstart
# - always() allows evaluating further conditional expressions even if
# needed jobs were skipped
if: |
always()
runs-on: ubuntu-20.04
needs: [ linux-build ]
steps:
- name: Git Shallow Checkout
uses: actions/checkout@v3

- name: Download linux release artifact
uses: actions/download-artifact@v3
with:
name: linux-release-${{ github.run_id }}
path: release/

- name: Run Go Quickstart Test
timeout-minutes: 5
run: |
go clean -testcache;
go test -v -tags "quickstart automated" ./ziti/cmd/edge/...;

publish:
name: Publish Binaries
# - always() allows evaluating further conditional expressions even if
Expand Down
2 changes: 1 addition & 1 deletion quickstart/docker/.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ZITI_USER=admin
ZITI_PWD=

ZITI_INTERFACE=0.0.0.0
# ZITI_GO_VERSION=

# controller name, address/port information
ZITI_CTRL_NAME=ziti-controller
ZITI_CTRL_EDGE_ADVERTISED_ADDRESS=ziti-edge-controller
Expand Down
9 changes: 7 additions & 2 deletions quickstart/test/compose-test.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ echo "INFO: Testing Compose project $PWD"

declare -a QUICK_FILES=(
../go.{mod,sum}
./ziti/cmd/edge/quickstart_manual_test.go
test/compose.override.yml
docker/{simplified-docker-compose.yml,.env}
)
Expand Down Expand Up @@ -95,7 +94,7 @@ mv ./simplified-docker-compose.yml ./compose.yml
# learn the expected Go version from the Go mod file so we can pull the correct container image
ZITI_GO_VERSION="$(awk '/^go[[:space:]]+/ {print $2}' ./go.mod)"
# make this var available in the Compose project
sed -Ee "s/^(#[[:space:]]+)?(ZITI_GO_VERSION)=.*/\2=${ZITI_GO_VERSION}/" \
sed -E \
-e "s/^(#[[:space:]]+)?(ZITI_PWD)=.*/\2=${ZITI_PWD}/" \
-e "s/^(#[[:space:]]+)?(ZITI_INTERFACE)=.*/\2=${ZITI_INTERFACE:-127.0.0.1}/" ./.env > ./.env.tmp
mv ./.env.tmp ./.env
Expand All @@ -111,6 +110,12 @@ done
# any halt after this point should cause the Compose project to be torn down
trap down_project SIGTERM SIGINT EXIT

# these compose vars are used to configure the golang service that runs the test suite
echo -e "ZITI_GO_VERSION=${ZITI_GO_VERSION}"\
"\nGOPATH=${GOPATH:-${HOME}/go}"\
"\nZITI_QUICK_DIR=${ZITI_QUICK_DIR}" \
>> ./.env

# if ZITI_QUICK_IMAGE_TAG is set then run the locally-built image
if [[ -n "${ZITI_QUICK_IMAGE_TAG:-}" ]]; then
sed -Ee "s/^(#[[:space:]]+)?(ZITI_VERSION)=.*/\2=${ZITI_QUICK_IMAGE_TAG}/" ./.env > ./.env.tmp
Expand Down
7 changes: 5 additions & 2 deletions quickstart/test/compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ services:
quickstart-test:
image: golang:${ZITI_GO_VERSION:-noop}-alpine
volumes:
- .:/mnt
# mount the parent dir of the quickstart, which is the top-level of the ziti repo working copy, as /mnt
- ${ZITI_QUICK_DIR:-noop}/..:/mnt
- ${GOPATH:-noop}:/go
working_dir: /mnt
environment:
- ZITI_PWD
networks:
- ziti
command: go test -v ./quickstart_test.go
command: >
go test -v -tags "quickstart manual" ./ziti/cmd/edge/...
Loading