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

extract the integration tests writen in the ci file as a script file. #37

Merged
merged 5 commits into from
May 28, 2021

Conversation

utam0k
Copy link
Member

@utam0k utam0k commented May 26, 2021

No description provided.

@utam0k utam0k requested a review from tsturzl May 26, 2021 09:57
@utam0k
Copy link
Member Author

utam0k commented May 26, 2021

It's not a problem in CI, but in my local, the memory of cgroups failed.
For now, I want to capture this PR in main.

@tsturzl
Copy link
Collaborator

tsturzl commented May 26, 2021

I'm wondering if it might be worthwhile to setup local tooling for testing against multiple different Linux distributions. This work might actually help with this. I'll outline that work in a new ticket.

Copy link
Collaborator

@tsturzl tsturzl left a comment

Choose a reason for hiding this comment

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

Unless I'm missing something, I don't think this works since the integration tests are never build before executing. Probably adding a short instruction to the README.md would be a good idea. Also probably need to outline that in order to run the tests locally you need to have golang compiler and node-tap dependencies installed.

exit 1
fi
done
run: ./integration_test.sh
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where does the build happen for the integration tests now?

Copy link
Member Author

Choose a reason for hiding this comment

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

@tsturzl The build of the integration test is included in this script.

@@ -0,0 +1,12 @@
#!/bin/bash
Copy link
Collaborator

Choose a reason for hiding this comment

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

This script fails locally for me because the tests haven't been compiled. Also setting up testing might be worth a short addition to the README.md

Copy link
Collaborator

Choose a reason for hiding this comment

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

So the integration test passing was actually a false positive, if you look at it the script failed in CI also. I think the script itself must not be returning the exit code correctly. So maybe this is another thing to fix, making sure the integration tests fail if anything returns a non-zero code, perhaps this is as easy as adding set -e to the script? See the CI failure here: https://github.com/utam0k/youki/pull/37/checks?check_run_id=2673869152#step:6:18

@utam0k
Copy link
Member Author

utam0k commented May 26, 2021

@tsturzl
Thanks for the advice. Your comments are very informative. Please wait a moment as I will respond after I finish my work today.

@utam0k utam0k force-pushed the add-integration-tests branch 5 times, most recently from 742335a to 1db813a Compare May 27, 2021 12:49
@utam0k utam0k force-pushed the add-integration-tests branch from 1db813a to 461fae0 Compare May 27, 2021 12:54
@utam0k
Copy link
Member Author

utam0k commented May 27, 2021

@tsturzl
Your advice has been reflected in this PR. Please review it again.

Copy link
Collaborator

@tsturzl tsturzl left a comment

Choose a reason for hiding this comment

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

Tested, and it works locally

Copy link
Collaborator

@tsturzl tsturzl left a comment

Choose a reason for hiding this comment

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

Actually, take a look at the CI. The CI is still failing, which might not be an issue concerning this ticket, however the CI on this PR says it succeeded when it really didn't. The exit code of the script is being set explicitly instead of returning the error code of the failed command. If you add set -e to the top of integration_test.sh that should fix the issue and it should error out of the bash script with the proper exit code. I believe using set -e will give a similar behavior to when the commands were written inline in the workflow yaml, where the script fill fail and return the failure exit code whenever any command comes back non-zero.

@utam0k
Copy link
Member Author

utam0k commented May 27, 2021

@tsturzl Thank you for being so cautious. Your review is very helpful.
This part of the code is the set -e part. When I added the test cases that should actually fail, CI failed.
https://github.com/utam0k/youki/pull/37/files#diff-d2da4d075c191015bceebd47b3e6229755e65bed685c0cdd2b07a08343b9e49cR1
What probably looks like a failure in CI is the error log of the test that should fail (e.g., container creation fails with invalid value).
So it looks like this is probably working correctly, what do you think?

@tsturzl
Copy link
Collaborator

tsturzl commented May 28, 2021

@utam0k I agree, it looks like as far as this PR is concerned things look good. However I'm going to file a bug report concerning this failure hopefully tonight after dinner when I have time to read through it a little more.

@utam0k
Copy link
Member Author

utam0k commented May 28, 2021

@tsturzl
Thank you for your review.
Bug reports are very helpful. I am looking forward to it. Have a good dinner time :)

However I'm going to file a bug report concerning this failure hopefully tonight after dinner when I have time to read through it a little more.

@utam0k utam0k merged commit ea9186d into main May 28, 2021
@tsturzl
Copy link
Collaborator

tsturzl commented May 28, 2021

I think I totally misunderstood you before. I thought the error messages were failures and the exit codes were maybe getting caught somewhere. My mistake. I don't believe there to be a bug, I just missed what you said:

What probably looks like a failure in CI is the error log of the test that should fail

Sometimes I'm reading these on my phone while I'm doing other things, and miss things. Thank you for the clarification!

@utam0k
Copy link
Member Author

utam0k commented May 28, 2021

@tsturzl In fact, your point wasn't wrong, since the CI passed even if the first commit failed.
Please keep up the nice reviews.

@utam0k utam0k deleted the add-integration-tests branch May 28, 2021 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants