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

[wip] Add logs for kubernetes events #6655

Closed
wants to merge 1 commit into from
Closed
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
25 changes: 25 additions & 0 deletions .github/workflows/functional-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ jobs:
message: |
:x: Failed to install Radius for ${{ matrix.name }} functional test. Please check [the logs](${{ env.ACTION_LINK }}) for more details
- name: Publish Terraform test recipes
id: publish-tf-recipes
run: |
make publish-test-terraform-recipes
- name: Run functional tests
Expand Down Expand Up @@ -576,3 +577,27 @@ jobs:
labels: ['bug', 'test-failure'],
body: `## Bug information \n\nThis bug is generated automatically if the scheduled functional test fails. The Radius functional test operates on a schedule of every 4 hours during weekdays and every 12 hours over the weekend. It's important to understand that the test may fail due to workflow infrastructure issues, like network problems, rather than the flakiness of the test itself. For the further investigation, please visit [here](${process.env.ACTION_LINK}).`
})
- name: Get pod logs for recipe publishing failure
id: get-pod-logs
if: failure() && steps.publish-tf-recipes.outcome == 'failure'
run: |
# Create pod-logs directory
mkdir -p recipes/pod-logs
# Get pod logs and save to file
namespace="radius-test-tf-module-server"
label="app.kubernetes.io/name=tf-module-server"
pod_names=($(kubectl get pods -l $label -n $namespace -o jsonpath='{.items[*].metadata.name}'))
for pod_name in "${pod_names[@]}"; do
kubectl logs $pod_name -n $namespace > recipes/pod-logs//${pod_name}.txt
done
echo "Pod logs saved to playwright/pod-logs/"
# Get kubernetes events and save to file
kubectl get events -n $namespace > playwright/pod-logs/events.txt
- name: Upload Pod logs for failed steps
uses: actions/upload-artifact@v3
if: failure() && steps.publish-tf-recipes.outcome.outcome == 'success'
with:
name: recipes-pod-logs
path: recipes/pod-logs
retention-days: 30
if-no-files-found: error
Loading