-
Notifications
You must be signed in to change notification settings - Fork 375
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
Collect test artifacts as a separate step in the test pipeline #2848
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Moves the relevant logs to the staging directory | ||
# | ||
set -euxo pipefail | ||
|
||
# | ||
# The execute_test.sh script gives ownership of the log directory to the 'waagent' user in | ||
# the Docker container; re-take ownership | ||
# | ||
sudo find "$LOGS_DIRECTORY" -exec chown "$USER" {} \; | ||
|
||
# | ||
# Move the logs for failed tests to a temporary location | ||
# | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/tmp | ||
for log in $(grep -l MARKER-LOG-WITH-ERRORS "$LOGS_DIRECTORY"/*.log); do | ||
mv "$log" "$BUILD_ARTIFACTSTAGINGDIRECTORY"/tmp | ||
done | ||
|
||
# | ||
# Move the environment logs to "environment_logs" | ||
# | ||
if ls "$LOGS_DIRECTORY"/env-*.log > /dev/null 2>&1; then | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/environment_logs | ||
mv "$LOGS_DIRECTORY"/env-*.log "$BUILD_ARTIFACTSTAGINGDIRECTORY"/environment_logs | ||
fi | ||
|
||
# | ||
# Move the rest of the logs to "test_logs" | ||
# | ||
if ls "$LOGS_DIRECTORY"/*.log > /dev/null 2>&1; then | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/test_logs | ||
mv "$LOGS_DIRECTORY"/*.log "$BUILD_ARTIFACTSTAGINGDIRECTORY"/test_logs | ||
fi | ||
|
||
# | ||
# Move the logs for failed tests to the main directory | ||
# | ||
if ls "$BUILD_ARTIFACTSTAGINGDIRECTORY"/tmp/*.log > /dev/null 2>&1; then | ||
mv "$BUILD_ARTIFACTSTAGINGDIRECTORY"/tmp/*.log "$BUILD_ARTIFACTSTAGINGDIRECTORY" | ||
fi | ||
rmdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/tmp | ||
|
||
# | ||
# Move the logs collected from the test VMs to vm_logs | ||
# | ||
if ls "$LOGS_DIRECTORY"/*.tgz > /dev/null 2>&1; then | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/vm_logs | ||
mv "$LOGS_DIRECTORY"/*.tgz "$BUILD_ARTIFACTSTAGINGDIRECTORY"/vm_logs | ||
fi | ||
|
||
# | ||
# Move the main LISA log and the JUnit report to "runbook_logs" | ||
# | ||
# Note that files created by LISA are under .../lisa/<date>/<unique_name>" | ||
# | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/runbook_logs | ||
mv "$LOGS_DIRECTORY"/lisa/*/*/lisa-*.log "$BUILD_ARTIFACTSTAGINGDIRECTORY"/runbook_logs | ||
mv "$LOGS_DIRECTORY"/lisa/*/*/agent.junit.xml "$BUILD_ARTIFACTSTAGINGDIRECTORY"/runbook_logs | ||
|
||
# | ||
# Move the rest of the LISA logs to "lisa_logs" | ||
# | ||
if [[ ${COLLECT_LISA_LOGS,,} == 'true' ]]; then # case-insensitive comparison | ||
mkdir "$BUILD_ARTIFACTSTAGINGDIRECTORY"/lisa_logs | ||
mv "$LOGS_DIRECTORY"/lisa/*/*/* "$BUILD_ARTIFACTSTAGINGDIRECTORY"/lisa_logs | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, the time outs not captured here in exit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
azure pipelines kills the process after 60 min so the code to collect logs is not executed. the PR moves that code to a different step, which will be executed after this one is killed