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

Fix tests on fedora #556

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Fix tests on fedora #556

merged 2 commits into from
Aug 14, 2024

Conversation

SlouchyButton
Copy link
Contributor

Two issues are addressed, both mentioned in #554. When build fails, it will now handle the situation correctly and stop all depending tests from running while also causing the test to fail and return non-zero code. Code that is handling this is taken from s2i-python-container.

While debugging the code, I have encountered a duplicate function defined in the run file, despite already being present in test-lib.sh, so the local version was removed.

Dependency nio4r in puma-test-app is bumped to the newest version to prevent build failing. This is related to #550.

Fixes: #554

This prevents tests to pass if the build fails - since if
this happens, the test will still continue and try to run the container.
This commit adds a new test entry called build, which will fail and stop
all depending tests from running. This will also cause tests to
correctly return non-zero return code.
@phracek phracek requested review from pvalena and phracek August 1, 2024 08:16
@phracek
Copy link
Member

phracek commented Aug 1, 2024

@jackorp PTAL as well.

@phracek
Copy link
Member

phracek commented Aug 1, 2024

[test-all]

@@ -54,14 +54,6 @@ run_test_application() {
docker run --user=100001 --rm --cidfile=${cid_file} ${IMAGE_NAME}-testapp
}

ct_check_testcase_result() {
Copy link
Member

Choose a reason for hiding this comment

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

Good catch !!!

# Negative test & zero exit status = ERROR.
# Tests with '-should-fail-' in their name should fail during a build,
# expecting non-zero exit status.
evaluate_build_result() {
Copy link
Member

Choose a reason for hiding this comment

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

Copy paste from s2i-python-container.

Think about to move it to 'test-lib.sh' in future. Just nit-pick

Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

Everything LGTM. Let's wait for the tests. Good Job !!!!!

@jackorp
Copy link
Contributor

jackorp commented Aug 1, 2024

LGTM.

I'd also like to raise one more thought. While the build failed, the tests didn't fail. Even though I'd expect the tests to be using the built container, IOW to fail at some point because they can't use the container, they used I presume previous build result. Would it make sense to clean up the container after the collections of test that need it finish?

@SlouchyButton
Copy link
Contributor Author

LGTM.

I'd also like to raise one more thought. While the build failed, the tests didn't fail. Even though I'd expect the tests to be using the built container, IOW to fail at some point because they can't use the container, they used I presume previous build result. Would it make sense to clean up the container after the collections of test that need it finish?

I have also thought about that, and it seemed really weird, why can the test pass using a container that failed to build. It showed the same behavior even locally, even tho I have previously run tests on this container locally, so it would make sense that it used previous results from the last passed container build.

I can investigate this further, but I feel like it might be better to split it into different issue+PR not to make this too big, since I think that the major change here is the dependency update, not general test fixes - but that's up to you.

@jackorp
Copy link
Contributor

jackorp commented Aug 1, 2024

it might be better to split it into different issue+PR

Absolutely. I was trying to find whether it was just me or if there is a cause for investigation.

I'll make an issue.

I think that the major change here is the dependency update

Agreed. More general test fixes can be left for other time.

@SlouchyButton
Copy link
Contributor Author

it might be better to split it into different issue+PR

Absolutely. I was trying to find whether it was just me or if there is a cause for investigation.

I'll make an issue.

I think that the major change here is the dependency update

Agreed. More general test fixes can be left for other time.

Great, u can assign me to the issue, since I have already poked around the issue. I'll take a look at it when I'll have some spare time.

@jackorp
Copy link
Contributor

jackorp commented Aug 1, 2024

@SlouchyButton #557 now exists, but I don't have sufficient perms to edit those fields.

@phracek
Copy link
Member

phracek commented Aug 14, 2024

[test-all]

@phracek
Copy link
Member

phracek commented Aug 14, 2024

I will fix OpenShift 4 tests later on. Let's get merge it. The failed tests do not block this PR.

@phracek phracek merged commit 9ef88c8 into sclorg:master Aug 14, 2024
16 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fedora Ruby 3.3 test passes but the container build fails.
3 participants