[test] Functional test housekeeping#1964
Merged
helsaawy merged 1 commit intomicrosoft:mainfrom Mar 7, 2024
Merged
Conversation
1e84e8c to
d83b7f7
Compare
d83b7f7 to
718f4ea
Compare
718f4ea to
0fb735a
Compare
Merged
0fb735a to
0ae9690
Compare
0ae9690 to
b7a9733
Compare
b7a9733 to
8bad8ea
Compare
8bad8ea to
4aabbe2
Compare
| # run tests | ||
| - name: Test repo | ||
| run: ${{ env.GOTESTCMD }} -gcflags=all=-d=checkptr -tags admin ./... | ||
| run: ${{ env.GOTESTSUM_CMD }} -gcflags=all=-d=checkptr -tags admin -timeout=20m ./... |
There was a problem hiding this comment.
why does only this one need a timeout?
Contributor
Author
There was a problem hiding this comment.
the default timeout of 10 minutes was cutting it close in some cases, i think
katiewasnothere
approved these changes
Mar 7, 2024
katiewasnothere
left a comment
There was a problem hiding this comment.
lgtm minus a few questions/nits
Remove unused/legacy functional test flags/environment variables. Unify [TestMain] control flow, so there is only one exit call, and `defer` is used to run cleanup after the tests are run. Standardize UVM `default[L|W]COWOptions` to accept a context, and add context parameter to `namespacedContext` Remove all build tags aside from `functional`, since features are used to select the tests to run. This standardizes the functional tests with the cri-containerd tests, even though the feature names themselves are different. Add `test/pkg/uvm.CreateWCOW` function to mirror `CreateLCOW`, and add `Create` and `CreateAndStart` functions that pick LCOW or WCOW based on the options provided. Have uVM scratch and image layers be created under a dedicated and persisted folder within `%TEMP%` that is excluded from Windows defender. (The folder will be removed during OS restart, regardless of contents.) Remove copied OCI spec options from `test/internal/oci`, add new options for creating HostProcess containers. Add a `internal\sync.OnceValue`(`Ctx`) function that mirrors `sync.OnceValues` (introduced in go1.21) to have a type-safe `Once` function. Check that required privileges are held (only once) when unpacking Windows layers. Fix LCOW tests in `lcow_test.go` that were setting `KernelDirect` without also updating `KernelFile`. Add `util.Context` function to create context that times out before test timeout, to help with timing issues and allow time for cleanup and logging. Rename `cri_util` to `criutil`, since underscores are frowned upon in package names. Add a `test` prefix to `github.com/Microsoft/hcsshim/test/pkg/*` and `github.com/Microsoft/hcsshim/test/internal/*` imports to be consistent across all `test/functional/*` files. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
4aabbe2 to
558c21b
Compare
ambarve
pushed a commit
to ambarve/hcsshim
that referenced
this pull request
May 1, 2024
Remove unused/legacy functional test flags/environment variables. Unify [TestMain] control flow, so there is only one exit call, and `defer` is used to run cleanup after the tests are run. Standardize UVM `default[L|W]COWOptions` to accept a context, and add context parameter to `namespacedContext` Remove all build tags aside from `functional`, since features are used to select the tests to run. This standardizes the functional tests with the cri-containerd tests, even though the feature names themselves are different. Add `test/pkg/uvm.CreateWCOW` function to mirror `CreateLCOW`, and add `Create` and `CreateAndStart` functions that pick LCOW or WCOW based on the options provided. Have uVM scratch and image layers be created under a dedicated and persisted folder within `%TEMP%` that is excluded from Windows defender. (The folder will be removed during OS restart, regardless of contents.) Remove copied OCI spec options from `test/internal/oci`, add new options for creating HostProcess containers. Add a `internal\sync.OnceValue`(`Ctx`) function that mirrors `sync.OnceValues` (introduced in go1.21) to have a type-safe `Once` function. Check that required privileges are held (only once) when unpacking Windows layers. Fix LCOW tests in `lcow_test.go` that were setting `KernelDirect` without also updating `KernelFile`. Add `util.Context` function to create context that times out before test timeout, to help with timing issues and allow time for cleanup and logging. Rename `cri_util` to `criutil`, since underscores are frowned upon in package names. Add a `test` prefix to `github.com/Microsoft/hcsshim/test/pkg/*` and `github.com/Microsoft/hcsshim/test/internal/*` imports to be consistent across all `test/functional/*` files. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com> (cherry picked from commit 523fe7b) Signed-off-by: Amit Barve <ambarve@microsoft.com>
princepereira
pushed a commit
to princepereira/hcsshim
that referenced
this pull request
Aug 29, 2024
Remove unused/legacy functional test flags/environment variables. Unify [TestMain] control flow, so there is only one exit call, and `defer` is used to run cleanup after the tests are run. Standardize UVM `default[L|W]COWOptions` to accept a context, and add context parameter to `namespacedContext` Remove all build tags aside from `functional`, since features are used to select the tests to run. This standardizes the functional tests with the cri-containerd tests, even though the feature names themselves are different. Add `test/pkg/uvm.CreateWCOW` function to mirror `CreateLCOW`, and add `Create` and `CreateAndStart` functions that pick LCOW or WCOW based on the options provided. Have uVM scratch and image layers be created under a dedicated and persisted folder within `%TEMP%` that is excluded from Windows defender. (The folder will be removed during OS restart, regardless of contents.) Remove copied OCI spec options from `test/internal/oci`, add new options for creating HostProcess containers. Add a `internal\sync.OnceValue`(`Ctx`) function that mirrors `sync.OnceValues` (introduced in go1.21) to have a type-safe `Once` function. Check that required privileges are held (only once) when unpacking Windows layers. Fix LCOW tests in `lcow_test.go` that were setting `KernelDirect` without also updating `KernelFile`. Add `util.Context` function to create context that times out before test timeout, to help with timing issues and allow time for cleanup and logging. Rename `cri_util` to `criutil`, since underscores are frowned upon in package names. Add a `test` prefix to `github.com/Microsoft/hcsshim/test/pkg/*` and `github.com/Microsoft/hcsshim/test/internal/*` imports to be consistent across all `test/functional/*` files. Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove unused/legacy functional test flags/environment variables.
Unify
TestMaincontrol flow, so there is only one exit call, anddeferis used to run cleanup after the tests are run.Standardize UVM
default[L|W]COWOptionsto accept a context, and add context parameter tonamespacedContext.Remove all build tags aside from
functional, since features are used to select the tests to run. This standardizes the functional tests with the cri-containerd tests, even though the feature names themselves are different.Add the
featureUVMto all tests that create a uVM, so that virtualization tests can be filtered out.Add
test/pkg/uvm.CreateWCOWfunction to mirrorCreateLCOW, and addCreateandCreateAndStartfunctions that pick LCOW or WCOW based on the options provided.Have uVM scratch and image layers be created under a dedicated and persisted folder within
%TEMP%that is excluded from Windows defender.(The folder will be removed during OS restart, regardless of contents.)
Remove copied OCI spec options from
test/internal/oci, add new options for creating HostProcess containers.Add a
internal\sync.OnceValue(Ctx) function that mirrorssync.OnceValues(introduced in go1.21) to have a type-safeOncefunction to use when initializing testing values.Check that required privileges are held (only once) when unpacking Windows layers.
Fix LCOW tests in
lcow_test.gothat were settingKernelDirectwithout also updatingKernelFile.Standardize how (testing) binaries are built in the CI.
Relies on #1937