Skip to content

Commit

Permalink
patch(integration_test_charm.yaml): Collect microk8s logs if set up f…
Browse files Browse the repository at this point in the history
…ails (#218)

To debug intermittent issue
#217
  • Loading branch information
carlcsaposs-canonical authored Jul 26, 2024
1 parent 5ed8c65 commit 07f8ca1
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/integration_test_charm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
needs:
- collect-integration-tests
runs-on: ${{ matrix.groups.runner || fromJSON(needs.collect-integration-tests.outputs.default_runner) }}
timeout-minutes: 277 # Sum of steps `timeout-minutes` + 5
timeout-minutes: 287 # Sum of steps `timeout-minutes` + 5
steps:
- name: (Data Platform hosted) Write job name to file
# Data Platform hosted
Expand Down Expand Up @@ -347,6 +347,7 @@ jobs:
sudo microk8s stop
sudo microk8s start
- name: Set up microk8s
id: microk8s-setup
timeout-minutes: 15
if: ${{ inputs.cloud == 'microk8s' }}
run: |
Expand All @@ -360,6 +361,20 @@ jobs:
mkdir ~/.kube/
# Used by lightkube and kubernetes (Python package)
sg '${{ steps.parse-cloud.outputs.group }}' -c "microk8s config > ~/.kube/config"
# Temporarily collect logs to debug intermittent issue
# https://github.com/canonical/data-platform-workflows/issues/217
- name: Collect microk8s logs for debugging
timeout-minutes: 5
if: ${{ failure() && steps.microk8s-setup.outcome == 'failure' }}
run: sudo microk8s inspect
- name: Upload microk8s logs for debugging
timeout-minutes: 5
if: ${{ failure() && steps.microk8s-setup.outcome == 'failure' }}
uses: actions/upload-artifact@v4
with:
name: debug-logs-microk8s-integration-test-charm-${{ inputs.cloud }}-juju-${{ inputs.juju-agent-version || steps.parse-versions.outputs.snap_channel_for_artifact }}-${{ inputs.architecture }}-${{ matrix.groups.artifact_group_id }}
path: /var/snap/microk8s/current/inspection-report-*.tar.gz
if-no-files-found: error
- timeout-minutes: 1
run: snap list
- name: Pre-download lxd image
Expand Down Expand Up @@ -474,7 +489,7 @@ jobs:
if: ${{ success() || (failure() && steps.tests.outcome == 'failure') }}
uses: actions/upload-artifact@v4
with:
name: logs-intergration-test-charm-${{ inputs.cloud }}-juju-${{ inputs.juju-agent-version || steps.parse-versions.outputs.snap_channel_for_artifact }}-${{ inputs.architecture }}-${{ matrix.groups.artifact_group_id }}
name: logs-integration-test-charm-${{ inputs.cloud }}-juju-${{ inputs.juju-agent-version || steps.parse-versions.outputs.snap_channel_for_artifact }}-${{ inputs.architecture }}-${{ matrix.groups.artifact_group_id }}
path: ~/logs/
if-no-files-found: error
- name: Disk usage
Expand Down

0 comments on commit 07f8ca1

Please sign in to comment.