Skip to content

libcontainer/configs: improve unit tests#2660

Merged
AkihiroSuda merged 1 commit intoopencontainers:masterfrom
kinvolk:mauricio/fix_unittests
Jan 27, 2021
Merged

libcontainer/configs: improve unit tests#2660
AkihiroSuda merged 1 commit intoopencontainers:masterfrom
kinvolk:mauricio/fix_unittests

Conversation

@mauriciovasquezbernal
Copy link
Copy Markdown
Contributor

@mauriciovasquezbernal mauriciovasquezbernal commented Oct 23, 2020

Test that CommandHook actually executes a new process with the given env
variables, parameters and json state.

This commit also solves an issue with the previous approach that was calling
'os.Exit(0)' failing to signal test failures.

cc @alban

Fixes: #2765

@kolyshkin
Copy link
Copy Markdown
Contributor

Can you please rebase this one since #2661 is merged?

@mauriciovasquezbernal
Copy link
Copy Markdown
Contributor Author

While studying these tests in more detail I found it was possible to improve them.
I updated the PR to do so, it also fixes the original problem I opened this PR for.

@kolyshkin
Copy link
Copy Markdown
Contributor

Need to be rebased again once #2666 is merged

@kolyshkin
Copy link
Copy Markdown
Contributor

Need to be rebased again once #2666 is merged

@mauriciovasquezbernal please rebase

@mauriciovasquezbernal
Copy link
Copy Markdown
Contributor Author

@kolyshkin rebased!

@mauriciovasquezbernal mauriciovasquezbernal changed the title libcontainer/configs: fix unit tests libcontainer/configs: improve unit tests Oct 31, 2020
Comment thread libcontainer/configs/config_test.go Outdated
@mauriciovasquezbernal mauriciovasquezbernal force-pushed the mauricio/fix_unittests branch 2 times, most recently from b11ae18 to c3ae42d Compare November 9, 2020 21:49
@mauriciovasquezbernal
Copy link
Copy Markdown
Contributor Author

@kolyshkin ping?

kolyshkin
kolyshkin previously approved these changes Jan 26, 2021
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM but needs to be rebased (again) to kick new CI

Test that CommandHook actually executes a new process with the given env
variables, parameters and json state.

This commit also solves an issue with the previous approach that was calling
'os.Exit(0)' failing to signal test failures.

Signed-off-by: Mauricio Vásquez <mauricio@kinvolk.io>
@mauriciovasquezbernal
Copy link
Copy Markdown
Contributor Author

@kolyshkin rebased and CI is green! :)

Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin kolyshkin added this to the 1.0.0-rc93 milestone Jan 27, 2021
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

LGTM, but it might be better to have set -eu

@AkihiroSuda AkihiroSuda merged commit 6721470 into opencontainers:master Jan 27, 2021
@mauriciovasquezbernal mauriciovasquezbernal deleted the mauricio/fix_unittests branch June 18, 2021 14:57
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.

Go 1.16: TestHelperProcess: a test that calls os.Exit(0) during execution of a test function will now be considered to fail

3 participants