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

Skip shim tests if shim binary is not found #1893

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

helsaawy
Copy link
Contributor

@helsaawy helsaawy commented Sep 8, 2023

Rather than failing tests when attempting to exec the shim executable, look up its path first and skip if it is not found.

Most testing binaries require that other binaries be located in the same directory as them (see require.Binary), but since the CI runs the shim tests directly, add require.BinaryInPath, which looks for the binary in the path or current working directory first.

Rather than failing tests when attempting to exec the shim executable,
look up its path first and skip if it is not found.

Most testing binaries require that other binaries be located in the same
directory as them (see `require.Binary`), but since the CI runs the shim
tests directly, add `require.BinaryInPath`, which looks for the binary
in the path or current working directory first.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
@helsaawy helsaawy requested a review from a team as a code owner September 8, 2023 17:27
@helsaawy helsaawy merged commit dd45838 into microsoft:main Sep 8, 2023
15 of 16 checks passed
@helsaawy helsaawy deleted the shim-test-require branch September 8, 2023 19:39
helsaawy added a commit to helsaawy/hcsshim that referenced this pull request Sep 20, 2023
Backport testing support functions in the `test/pkg` directory.
This includes changes from:
 - microsoft#1536
 - microsoft#1704
 - microsoft#1853
 - microsoft#1893

Rather than cherry-pick them, only changes to `test/pkg` are included,
since tests themselves will require significant changes to bring
up-to-date.

The goal is to expose testing functions so that tests can be moved out
of the repo.

Updated go version in `test` to 1.8, as required by `test/pkg/flag`.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
helsaawy added a commit to helsaawy/hcsshim that referenced this pull request Sep 27, 2023
Rather than failing tests when attempting to exec the shim executable,
look up its path first and skip if it is not found.

Most testing binaries require that other binaries be located in the same
directory as them (see `require.Binary`), but since the CI runs the shim
tests directly, add `require.BinaryInPath`, which looks for the binary
in the path or current working directory first.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
helsaawy added a commit that referenced this pull request Sep 28, 2023
Backport testing support functions in the `test/pkg` directory.
This includes changes from:
 - #1536
 - #1704
 - #1853
 - #1893

Rather than cherry-pick them, only changes to `test/pkg` are included,
since tests themselves will require significant changes to bring
up-to-date.

The goal is to expose testing functions so that tests can be moved out
of the repo.

Updated go version in `test` to 1.8, as required by `test/pkg/flag`.

Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
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