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

Issue 481 - Green Builds Showing Despite Test Failures #487

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 29 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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: 21 additions & 4 deletions src/test/resources/ci/scripts/exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ currentTime=(date +"%Y/%m/%d-%H:%M:%S:%3N")
# Operating system.
OS=$(uname -s)

# Boolean to see if any failure has occured while executing commands
failure="false"

main() {

setVscodeVersionToTest
Expand All @@ -40,6 +43,7 @@ main() {
npm run build
npm run compile
vsce package
updateExitStatus
else

#Initialisation step
Expand All @@ -66,28 +70,32 @@ main() {
chown -R runner src/test/resources/maven
chown -R runner src/test/resources/gradle
npm run test-mac-maven -- -u
updateExitStatus
npm run test-mac-gradle -- -u
updateExitStatus
else
npm run test -- -u
updateExitStatus
fi
else
# Run the plugin's install goal against the target vscode version
if [ $OS = "Darwin" ]; then
chown -R runner src/test/resources/maven
chown -R runner src/test/resources/gradle
npm run test-mac-maven -- -u -c $VSCODE_VERSION_TO_RUN
updateExitStatus
npm run test-mac-gradle -- -u -c $VSCODE_VERSION_TO_RUN

updateExitStatus
else
npm run test -- -u -c $VSCODE_VERSION_TO_RUN
updateExitStatus
fi
fi
fi

# If there were any errors, gather some debug data before exiting.
rc=$?
if [ "$rc" -ne 0 ]; then
echo "ERROR: Failure while driving npm install on plugin. rc: ${rc}."
if [ "$failure" = "true" ]; then
echo "ERROR: Failure while driving npm install on plugin."
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the way this script works now, this error message does not seem accurate. Please update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with following comment: "ERROR: Failure occurred while running the tests."


if [ $TYPE = "TEST" ]; then
echo "DEBUG: Maven Liberty messages.log:\n"
Expand Down Expand Up @@ -150,4 +158,13 @@ setVscodeVersionToTest() {
fi
}

# Finding the exit status of a command and updating failure boolean.
# Need to call this method after executing each npm command to store the status.
updateExitStatus() {
status=$?
if [ "$failure" = "false" ] && [ $status -ne 0 ]; then
failure="true"
fi
}

main "$@"
Loading