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

Download Application log files and upload as an artifact when enos scenarios fail #19860

Merged
merged 4 commits into from
Mar 31, 2023
Merged
Changes from 3 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
9 changes: 9 additions & 0 deletions .github/workflows/test-run-enos-scenario-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ jobs:
ENOS_VAR_vault_revision: ${{ inputs.vault-revision }}
ENOS_VAR_vault_bundle_path: ./support/downloads/${{ inputs.build-artifact-name }}
ENOS_VAR_vault_license_path: ./support/vault.hclic
ENOS_DEBUG_DATA_ROOT_DIR: ./support/debug-data
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
Expand Down Expand Up @@ -148,6 +149,14 @@ jobs:
id: run_retry
if: steps.run.outcome == 'failure'
run: enos scenario run --timeout 60m0s --chdir ./enos ${{ matrix.scenario }}
- name: Upload Debug Data
if: steps.run_retry.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
# The name of the artifact is the same as the matrix scenario name with the spaces replaced with underscores.
name: ${${{ matrix.scenario }}// /_}.zip
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't zip this directory, so don't need the .zip extension in the name

path: $ENOS_DEBUG_DATA_ROOT_DIR
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be relative to repo root, so we will need to add ./enos/$ENOS_DEBUG_DATA_ROOT_DIR. Not sure it accepts relative paths. Also reading the upload action looks like we need to pass the dir as $GITHUB_ENV variable. May be we can create a dir in /tmp and set it as $GITHUB_ENV variable, and pass that to both ENOS_DEBUG_DATA_ROOT_DIR and path ?

retention-days: 30
- name: Ensure scenario has been destroyed
if: ${{ always() }}
# With Enos version 0.0.11 the destroy step returns an error if the infrastructure
Expand Down