-
Notifications
You must be signed in to change notification settings - Fork 2.3k
ci: replace travis with GHA for Fedora 33 and CentOS 7 #2721
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1125ae7
tests/events.bats: unify duplicated code
kolyshkin 8ccd39a
ci: move commit length check from travis to gha
kolyshkin 7ecba23
ci: move cross compile check from travis to gha
kolyshkin e431fe6
ci: move misc validate tasks from travis to gha
kolyshkin 2dc1bf9
ci: move Fedora 33 and CentOS 7 tests to gha
kolyshkin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,25 +27,30 @@ function teardown() { | |
| [[ "${lines[0]}" == *"data"* ]] | ||
| } | ||
|
|
||
| @test "events --interval default" { | ||
| function test_events() { | ||
| # XXX: currently cgroups require root containers. | ||
| requires root | ||
| init_cgroup_paths | ||
|
|
||
| # run busybox detached | ||
| local status interval retry_every=1 | ||
| if [ $# -eq 2 ]; then | ||
| interval="$1" | ||
| retry_every="$2" | ||
| fi | ||
|
|
||
| runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox | ||
| [ "$status" -eq 0 ] | ||
|
|
||
| # spawn two sub processes (shells) | ||
| # the first sub process is an event logger that sends stats events to events.log | ||
| # the second sub process waits for an event that includes test_busybox then | ||
| # kills the test_busybox container which causes the event logger to exit | ||
| (__runc events test_busybox >events.log) & | ||
| # Spawn two subshels: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: subshells |
||
| # 1. Event logger that sends stats events to events.log. | ||
| (__runc events ${interval:+ --interval "$interval"} test_busybox >events.log) & | ||
| # 2. Waits for an event that includes test_busybox then kills the | ||
| # test_busybox container which causes the event logger to exit. | ||
| ( | ||
| retry 10 1 eval "grep -q 'test_busybox' events.log" | ||
| retry 10 "$retry_every" eval "grep -q 'test_busybox' events.log" | ||
| teardown_running_container test_busybox | ||
| ) & | ||
| wait # wait for the above sub shells to finish | ||
| wait # for both subshells to finish | ||
|
|
||
| [ -e events.log ] | ||
|
|
||
|
|
@@ -54,59 +59,16 @@ function teardown() { | |
| [[ "$output" == *"data"* ]] | ||
| } | ||
|
|
||
| @test "events --interval 1s" { | ||
| # XXX: currently cgroups require root containers. | ||
| requires root | ||
| init_cgroup_paths | ||
|
|
||
| # run busybox detached | ||
| runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox | ||
| [ "$status" -eq 0 ] | ||
|
|
||
| # spawn two sub processes (shells) | ||
| # the first sub process is an event logger that sends stats events to events.log once a second | ||
| # the second sub process tries 3 times for an event that incudes test_busybox | ||
| # pausing 1s between each attempt then kills the test_busybox container which | ||
| # causes the event logger to exit | ||
| (__runc events --interval 1s test_busybox >events.log) & | ||
| ( | ||
| retry 3 1 eval "grep -q 'test_busybox' events.log" | ||
| teardown_running_container test_busybox | ||
| ) & | ||
| wait # wait for the above sub shells to finish | ||
|
|
||
| [ -e events.log ] | ||
| @test "events --interval default" { | ||
| test_events | ||
| } | ||
|
|
||
| grep -q 'test_busybox' events.log | ||
| @test "events --interval 1s" { | ||
| test_events 1s 1 | ||
| } | ||
|
|
||
| @test "events --interval 100ms" { | ||
| # XXX: currently cgroups require root containers. | ||
| requires root | ||
| init_cgroup_paths | ||
|
|
||
| # run busybox detached | ||
| runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox | ||
| [ "$status" -eq 0 ] | ||
|
|
||
| #prove there is no carry over of events.log from a prior test | ||
| [ ! -e events.log ] | ||
|
|
||
| # spawn two sub processes (shells) | ||
| # the first sub process is an event logger that sends stats events to events.log once every 100ms | ||
| # the second sub process tries 3 times for an event that incudes test_busybox | ||
| # pausing 100s between each attempt then kills the test_busybox container which | ||
| # causes the event logger to exit | ||
| (__runc events --interval 100ms test_busybox >events.log) & | ||
| ( | ||
| retry 3 0.100 eval "grep -q 'test_busybox' events.log" | ||
| teardown_running_container test_busybox | ||
| ) & | ||
| wait # wait for the above sub shells to finish | ||
|
|
||
| [ -e events.log ] | ||
|
|
||
| grep -q 'test_busybox' events.log | ||
| test_events 100ms 0.1 | ||
| } | ||
|
|
||
| @test "events oom" { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
maybe
scriptandsstystuff should be moved to Makefile, but it can be worked out laterThere 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, this looks kinda ugly. I thought about a shell script or a program that checks if tty is available, and re-executes itself through script (and does other needed things) if not, and then execute whatever is passed on in arguments.
GHA is the only environment without a tty, so it does not make sense to have this in Makefile (at least unconditionally).
Let's do it later.