-
Notifications
You must be signed in to change notification settings - Fork 18
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
Update action version to 4 #33
Conversation
|
||
- name: fail if any test module failed | ||
run: jq .result testresults/result-*.json | grep -v ok && echo "Test modules failed" && exit 1 | ||
run: jq .result testresults/result-*.json | grep ok || (echo "Test modules failed" && exit 1) |
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.
Consider #31 (comment)
run: jq .result testresults/result-*.json | grep ok || (echo "Test modules failed" && exit 1) | |
run: jq .result testresults/result-*.json | grep -v ok && { echo "Test modules failed" && exit 1; } || true |
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.
Please see #33 (comment)
&& jq .result testresults/result-*.json | grep ok \ | ||
|| (echo "Test modules failed" && exit 1)' |
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.
Same grep and subshell problem as above,
&& jq .result testresults/result-*.json | grep ok \ | |
|| (echo "Test modules failed" && exit 1)' | |
&& jq .result testresults/result-*.json | grep -v ok \ | |
&& { echo "Test modules failed" && exit 1; } || true' |
@@ -13,4 +13,9 @@ jobs: | |||
steps: | |||
- uses: actions/checkout@v2 | |||
- name: Run isotovideo against test code, fail if any test module failed | |||
run: podman run --rm -it -v .:/tests:Z --entrypoint '' registry.opensuse.org/devel/openqa/containers/isotovideo:qemu-x86-jq /bin/sh -c 'isotovideo qemu_no_kvm=1 casedir=/tests && jq .result testresults/result-*.json | grep -v ok && echo "Test modules failed" && exit 1' | |||
run: | | |||
docker run --rm -v .:/tests:Z --entrypoint '' \ |
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.
Consider #31 (comment)
Is the switch from podman to docker intended? I thought podman is the preferred way.
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.
podman is not provided in the container. I found it easier to just switch to docker. i am not sure if that matters here
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.
I did not observe that. See https://github.com/os-autoinst/os-autoinst-distri-example/actions/runs/7275772852/job/19825501448#step:3:1
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.
I also saw that we still run ubuntu-20.04 here, created
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.
Whops, I will close #35 in favor of yours, it seems we observed the same. 😄
|
||
- name: Run isotovideo against test code | ||
run: isotovideo qemu_no_kvm=1 casedir=. | ||
run: isotovideo qemu_no_kvm=1 casedir=$(pwd) |
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.
why not keep .?
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.
not a significant reason. personal preference. it s quite similar
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.
then please revert
|
||
- name: fail if any test module failed | ||
run: jq .result testresults/result-*.json | grep -v ok && echo "Test modules failed" && exit 1 | ||
run: jq .result testresults/result-*.json | grep ok || (echo "Test modules failed" && exit 1) |
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.
that grep ok
would just mean that there is at least one test module that failed. But the purpose was to fail if any module fails. As we expect the execution in the example to fail what we can do is
run: jq .result testresults/result-*.json | grep ok || (echo "Test modules failed" && exit 1) | |
run: jq .result testresults/result-*.json | grep -v ok && (echo "At least one test module failed as expected" && exit 0) |
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.
i applied suggestion from @baierjan. review and resolve please
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.
Yes, I saw that you applied the suggestion from @baierjan. The problem is that this way we are ignoring results either way. But we should check for the expected result which is actually that test modules should fail which serves as the example
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.
Do you suggest that it is expected that the test will fail (i.e. the result of the isotovideo is no ok)? Running the pipeline locally yields testresults/result-boot.json
with the "result" : "ok"
, so the original code
run: jq .result testresults/result-*.json | grep -v ok && echo "Test modules failed" && exit 1 |
only fails the pipeline because of the empty match from grep (i.e. after removing all ok results, there is no other record).
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.
hm, you are right. That changed in a pull request from @Martchus some months ago. Then it should be
run: jq .result testresults/result-*.json | grep -v ok || (echo "Test modules failed" && exit 1)
right?
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.
I believe not. The success of grep -v ok
means something else than ok was matched (and that should be a failure); on the other hand, if grep -v ok
fails (with exit code 1, btw.) it means there is no other result than ok, so it is actually a success.
So what we want to have is
if $(jq .result testresults/result-*.json | grep -v ok); then echo "Test modules failed"; exit 1; else exit 0; fi
My original suggestion jq .result testresults/result-*.json | grep -v ok && { echo "Test modules failed" && exit 1; } || true
should be the same. The "only" issue here is, that it masks error in jq. If we want to solve that, we need to introduce a little more logic.
Maybe
test $(jq .result testresults/result-*.json | grep -v ok | wc -l) -eq 0 || { echo "Test modules failed"; exit 1; }
could be more readable?
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.
I have an even better idea as @josegomezr already fixed that use case for us :) -> #36
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.
Yes, that is the perfect solution.
registry.opensuse.org/devel/openqa/containers/isotovideo:qemu-x86-jq /bin/sh \ | ||
-c 'isotovideo qemu_no_kvm=1 casedir=/tests \ | ||
&& jq .result testresults/result-*.json | grep ok \ | ||
|| (echo "Test modules failed" && exit 1)' |
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.
same as above
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.
i applied suggestion from @baierjan. review and resolve please
.github/workflows/isotovideo.yml
Outdated
run: podman run --rm -it -v .:/tests:Z registry.opensuse.org/devel/openqa/containers/isotovideo:qemu-x86 qemu_no_kvm=1 casedir=/tests | ||
run: docker run --rm -v .:/tests:Z registry.opensuse.org/devel/openqa/containers/isotovideo:qemu-x86 qemu_no_kvm=1 casedir=/tests |
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.
Why would you change that?
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.
podman is not provided in the container. I found it easier to just switch to docker.
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.
In which container? The ubuntu-latest
provided by Github includes podman version 3.4.4 (see https://github.com/baierjan/actions-experiments/actions/runs/7842150230/job/21399883954)
@@ -13,4 +13,9 @@ jobs: | |||
steps: | |||
- uses: actions/checkout@v2 |
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.
Can you also change the action to actions/checkout@v4?
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.
Sure. i was thinking about that. I just do not know where to find the latest version
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.
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.
Done
51bd33e
to
b0b99d5
Compare
While reviewing #33 I found out that the comment about latest images is no longer relevant and in fact the latest image is now pointing to version 22.04. Let's remove the override and get back to latest image.
b0b99d5
to
8e6ab39
Compare
8e6ab39
to
c3ab292
Compare
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.
I believe we want to rebase over #36 and see what is left here.
Do we even need it anymore? |
c3ab292
to
c531d10
Compare
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.
Only a minor issue, the commit message now does not correspond with the changes inside the commit; otherwise LGTM
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.
Correct, "8428444" shouldn't say that it would fix isotovideo CI jobs
Signed-off-by: ybonatakis <[email protected]>
Due to isotovideo:qemu-x86-jq the step which installs jq is not needed. Signed-off-by: ybonatakis <[email protected]>
c531d10
to
316737b
Compare
No description provided.