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

Enable HA smoketest. Fixes #2636 #2641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
70 changes: 42 additions & 28 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ jobs:
fablab-ha-smoketest:
name: Fablab HA Smoketest
# not applicable to forks. shouldn't run on release build
if: false && github.repository_owner == 'openziti' && !startsWith(github.ref_name, 'release-v')
if: github.repository_owner == 'openziti' && !startsWith(github.ref_name, 'release-v')
runs-on: ubuntu-20.04
steps:
- name: Git Checkout
Expand Down Expand Up @@ -323,14 +323,15 @@ jobs:
$(go env GOPATH)/bin/smoketest create -d smoketest-ha-${GITHUB_RUN_NUMBER} -n smoketest-ha-${GITHUB_RUN_NUMBER} -l ha=true,environment=gh-fablab-ha-smoketest,ziti_version=$($(go env GOPATH)/bin/ziti-ci -q get-current-version)
$(go env GOPATH)/bin/smoketest up

# - name: Test Ziti Command
# shell: bash
# run: |
# echo "ZITI_ROOT=$(go env GOPATH)/bin" >> "$GITHUB_ENV"
# pushd zititest && go test -timeout 30m -v ./tests/... 2>&1 | tee test.out && popd
- name: Test Ziti Command
shell: bash
run: |
echo "ZITI_ROOT=$(go env GOPATH)/bin" >> "$GITHUB_ENV"
pushd zititest && go test -timeout 30m -v ./tests/... 2>&1 | tee test.out && popd

- name: Create fablab instance archive
if: always()
timeout-minutes: 30
env:
FABLAB_PASSPHRASE: ${{ secrets.FABLAB_PASSPHRASE }}
shell: bash
Expand All @@ -339,23 +340,35 @@ jobs:
cp ~/.fablab/config.yml smoketest-ha-${GITHUB_RUN_NUMBER}/
tar --exclude *terraform-provider-aws* -czvf - smoketest-ha-${GITHUB_RUN_NUMBER}/ | gpg --symmetric --cipher-algo aes256 --batch --quiet --passphrase ${FABLAB_PASSPHRASE} -o smoketest-ha-${GITHUB_RUN_NUMBER}.tar.gz.gpg
aws s3 cp ./smoketest-ha-${GITHUB_RUN_NUMBER}.tar.gz.gpg s3://ziti-smoketest-fablab-instances/

# - name: Test Report Generation
# if: always()
# shell: bash
# run: |
# go install github.com/jstemmer/go-junit-report/v2@latest
#$(go env GOPATH)/bin/go-junit-report -in zititest/test.out -out test-report.xml

# - name: Test Summary
# uses: test-summary/action@v2
# with:
# paths: |
# test-report.xml
# show: "fail, skip"
# if: always()

# END linux-build-steps

- name: Create Logs Archive
if: always()
run: |
$(go env GOPATH)/bin/smoketest get files '*' "./logs/{{ .Id }}/" ./logs

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: logs-ha-${{ github.run_id }}
path: logs/
compression-level: 7
retention-days: 5

- name: Test Report Generation
if: ${{ !cancelled() }}
shell: bash
run: |
go install github.com/jstemmer/go-junit-report/v2@latest
$(go env GOPATH)/bin/go-junit-report -in zititest/test.out -out test-report.xml

- name: Test Summary
uses: test-summary/action@v2
if: ${{ !cancelled() }}
with:
paths: |
test-report.xml
show: "fail, skip"

fablab-ha-smoketest-teardown:
name: Teardown HA SmokeTest
Expand All @@ -364,15 +377,16 @@ jobs:
needs: [ fablab-ha-smoketest ]
steps:
# allow time for investigation unless the workflow is cancelled or the smoketest succeeded or was skipped
- name: Sleep If Failed
if: needs.fablab-ha-smoketest.result != 'success' && needs.fablab-ha-smoketest.result != 'skipped' && needs.fablab-ha-smoketest.result != 'cancelled'
shell: bash
run: |
sleep 30m
#- name: Sleep If Failed
# if: needs.fablab-ha-smoketest.result != 'success' && needs.fablab-ha-smoketest.result != 'skipped' && needs.fablab-ha-smoketest.result != 'cancelled'
# shell: bash
# run: |
# sleep 30m

# release cloud resources if the smoketest succeeded, failed, or was cancelled; unnecessary if skipped
- name: Teardown Test Environment
if: needs.fablab-smoketest-ha.result != 'skipped'
timeout-minutes: 30
env:
FABLAB_PASSPHRASE: ${{ secrets.FABLAB_PASSPHRASE }}
shell: bash
Expand Down
Loading