-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add shaInfo target to collect all shas after the test run #651
Open
sophia-guo
wants to merge
3
commits into
adoptium:master
Choose a base branch
from
sophia-guo:results
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+88
−87
Open
Changes from 2 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 was deleted.
Oops, something went wrong.
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,76 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
TEST_ROOT="" | ||
SHAs_FILE="" | ||
workDIR=$(pwd) | ||
|
||
usage () | ||
{ | ||
echo 'This script use git command to get all shas in the provided TEST_ROOT and write the info into the SHAs file' | ||
echo 'Usage : ' | ||
echo ' --test_root_dir: optional' | ||
echo ' --shas_file: optianal, the file to write the sha info to. Default is to ../SHAs.txt' | ||
|
||
} | ||
|
||
parseCommandLineArgs() | ||
{ | ||
while [[ $# -gt 0 ]] && [[ ."$1" = .-* ]] ; do | ||
opt="$1"; | ||
shift; | ||
case "$opt" in | ||
"--test_root_dir" | "-d" ) | ||
TEST_ROOT="$1"; shift;; | ||
|
||
"--shas_file" | "-f" ) | ||
SHAs_FILE="$1"; shift;; | ||
|
||
"--help" | "-h" ) | ||
usage; exit 0;; | ||
|
||
*) echo >&2 "Invalid option: ${opt}"; echo "This option was unrecognized."; usage; exit 1; | ||
esac | ||
done | ||
if [ -z "$TEST_ROOT" ] || [ -z "$SHAs_FILE" ] || [ ! -d "$TEST_ROOT" ]; then | ||
echo "Error, please see the usage and also check if $TEST_ROOT is existing" | ||
usage | ||
exit 1 | ||
fi | ||
} | ||
|
||
timestamp() { | ||
date +"%Y%m%d-%H%M%S" | ||
} | ||
|
||
getSHAs() | ||
{ | ||
echo "Check shas in $TEST_ROOT and store the info in $SHAs_FILE" | ||
if [ ! -e "${SHAs_FILE}" ]; then | ||
echo "touch $SHAs_FILE" | ||
touch "$SHAs_FILE" | ||
fi | ||
|
||
cd "$TEST_ROOT" || exit | ||
find "$TEST_ROOT" -type d -name ".git" | while read -r gitDir; do | ||
repoDir=$(dirname "$gitDir") | ||
cd "$repoDir" || continue | ||
# append the info into $SHAs_FILR | ||
{ echo "================================================"; echo "timestamp: $(timestamp)"; echo "repo dir: $repoDir"; echo "git repo: "; git remote show origin -n | grep "Fetch URL:"; echo "sha:"; git rev-parse HEAD; } 2>&1 | tee -a "$SHAs_FILE" | ||
done | ||
} | ||
parseCommandLineArgs "$@" | ||
getSHAs | ||
cd "$workDIR" || exit | ||
|
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
Oops, something went wrong.
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.
shaInfor
before running the test? In the event of a crash, we will still retain the SHA information.shaInfor
toshaInfo
?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.
It can be done right after make compile. https://ci.adoptium.net/view/Test_grinder/job/Grinder/12117/ https://ci.adoptium.net/view/Test_grinder/job/Grinder/12118/
However it depends on what the crash is. If the crash exit the job instantly ( https://ci.adoptium.net/view/Test_grinder/job/Grinder/12124/console, this is not a test crash, still explain the scenario) , SHAs.txt is available but *.tap file unavailable, which won't help jenkins story unless we also archive it.
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.
Updated to shaInfo