Skip to content

Skip shim tests if shim binary is not found#1893

Merged
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:shim-test-require
Sep 8, 2023
Merged

Skip shim tests if shim binary is not found#1893
helsaawy merged 1 commit intomicrosoft:mainfrom
helsaawy:shim-test-require

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 <[email protected]>
@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
@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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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