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

Green Builds Showing Despite Test Failures #481

Open
aparnamichael opened this issue Jan 23, 2025 · 3 comments · May be fixed by #487
Open

Green Builds Showing Despite Test Failures #481

aparnamichael opened this issue Jan 23, 2025 · 3 comments · May be fixed by #487
Assignees

Comments

@aparnamichael
Copy link
Contributor

Even when tests are failing, the builds are showing as green.

PR- https://github.com/OpenLiberty/liberty-tools-vscode/actions/runs/12921114303?pr=478

Image

@gilbysunil14
Copy link
Contributor

The RunTests step in GHA is run through the script exec.sh. In mac machine, the tests are run through two commands test-mac-maven and test-mac-gradle in exec.sh file. See the below image:

Image

The rc command returns a specific value indicating whether the previous operation was successful or not. Since the tests in mac machine are run through two commands stated above, and even if the first command is unsuccessful and the second command is successful, then the GHA will show a green build.

Proposed solution would be to run the tests in mac machine thorough a single command npm run test

@TrevCraw
Copy link
Contributor

In the future, we may want to be able to run other kinds of tests. Typically, it is better to move towards being more modular and not less so. Is there not a way to capture the return code of individual npm commands? And then store those results in an array and check them at the end?

@gilbysunil14
Copy link
Contributor

@TrevCraw as per your suggestion moving forward with a modular approach. Instead of having an array we will have a boolean to see if any of the commands that executed got failed and if yes the build will be exited with an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants