Skip to content

Commit

Permalink
Fix issue #825 :Terratest readable output (#826)
Browse files Browse the repository at this point in the history
* terratest_log_parser
* terratest_dir
* DCO

Signed-off-by: AugustasV <reg1nt1z@gmail.com>

Co-authored-by: Jirka Kremser <535866+jkremser@users.noreply.github.com>
  • Loading branch information
AugustasV and jkremser committed Jan 20, 2022
1 parent 32879d9 commit ea42eb2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terratest-more-clusters.yaml
Expand Up @@ -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
26 changes: 24 additions & 2 deletions .github/workflows/terratest.yaml
Expand Up @@ -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
25 changes: 23 additions & 2 deletions .github/workflows/upgrade-testing.yaml
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -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))
Expand Down

0 comments on commit ea42eb2

Please sign in to comment.