diff --git a/.github/workflows/terratest-more-clusters.yaml b/.github/workflows/terratest-more-clusters.yaml index 269bc2bba8..79236cc17b 100644 --- a/.github/workflows/terratest-more-clusters.yaml +++ b/.github/workflows/terratest-more-clusters.yaml @@ -70,6 +70,6 @@ jobs: echo "Cluster 3 (cz):" kubectl get no -owide --context=k3d-test-gslb3 - - name: Terratest + - name: Run Terratest continue-on-error: true run: make terratest diff --git a/.github/workflows/terratest.yaml b/.github/workflows/terratest.yaml index 14ac5c796e..c6a8dd0c08 100644 --- a/.github/workflows/terratest.yaml +++ b/.github/workflows/terratest.yaml @@ -62,5 +62,27 @@ jobs: echo "Cluster 2 (us):" kubectl get no -owide --context=k3d-test-gslb2 - - name: Terratest - run: make terratest + - name: Run Terratest + run: | + mkdir -p ${{ github.workspace }}/tmp/terratest + echo "::group::Terratest logs" + make terratest | tee ${{ github.workspace }}/tmp/terratest/all.log + echo "::endgroup::" + + - name: Terratest log parser + run: | + curl --location --silent --fail --show-error -o terratest_log_parser https://github.com/gruntwork-io/terratest/releases/download/v0.38.8/terratest_log_parser_linux_amd64 + chmod +x terratest_log_parser + ./terratest_log_parser --testlog ${{ github.workspace }}/tmp/terratest/all.log --outputdir ${{ github.workspace }}/tmp/terratest + echo -e "\n\nTerratest logs:" + for log in $(find ${{ github.workspace }}/tmp/terratest -regex ".*/Test.*\.log"); do + echo "::group::$(basename $log)" + cat $log + echo "::endgroup::" + done + echo Separated log files will be available under artifact section at https://github.com/k8gb-io/k8gb/actions/runs/${{ github.run_id }} + + - uses: actions/upload-artifact@v2 + with: + name: terratest-logs + path: ${{ github.workspace }}/tmp/terratest diff --git a/.github/workflows/upgrade-testing.yaml b/.github/workflows/upgrade-testing.yaml index 709e18a9d7..8227e560f1 100644 --- a/.github/workflows/upgrade-testing.yaml +++ b/.github/workflows/upgrade-testing.yaml @@ -60,5 +60,26 @@ jobs: - name: K8GB deploy test version run: make deploy-test-version list-running-pods - - name: Terratest - run: make terratest + - name: Run Terratest + run: | + mkdir -p ${{ github.workspace }}/tmp/terratest + make terratest | tee ${{ github.workspace }}/tmp/terratest/all.log + echo "::endgroup::" + + - name: Terratest log parser + run: | + curl --location --silent --fail --show-error -o terratest_log_parser https://github.com/gruntwork-io/terratest/releases/download/v0.38.8/terratest_log_parser_linux_amd64 + chmod +x terratest_log_parser + ./terratest_log_parser --testlog ${{ github.workspace }}/tmp/terratest/all.log --outputdir ${{ github.workspace }}/tmp/terratest + echo -e "\n\nTerratest logs:" + for log in $(find ${{ github.workspace }}/tmp/terratest -regex ".*/Test.*\.log"); do + echo "::group::$(basename $log)" + cat $log + echo "::endgroup::" + done + echo Separated log files will be available under artifact section at https://github.com/k8gb-io/k8gb/actions/runs/${{ github.run_id }} + + - uses: actions/upload-artifact@v2 + with: + name: terratest-logs + path: ${{ github.workspace }}/tmp/terratest diff --git a/Makefile b/Makefile index c6235600d1..b5cb079964 100644 --- a/Makefile +++ b/Makefile @@ -422,7 +422,7 @@ test-round-robin: test-failover: @$(call hit-testapp-host, "failover.cloud.example.com") -# executes terra-tests +# executes terratests .PHONY: terratest terratest: # Run terratest suite @$(eval RUNNING_CLUSTERS := $(shell k3d cluster list --no-headers | grep $(CLUSTER_NAME) -c))