-
Notifications
You must be signed in to change notification settings - Fork 264
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
Update (functional) tests directory #1263
Conversation
Updated `./tests/functional` to: - use command line arguments to configure tests - use `ctr.exe` to find the layer path for images - better delineate between utilities and test with config - added client to interact with containerd directly Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Added in changes from microsoft@8b80eda Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
Moved test utilities from `test/functional/utilities` to `test/testutil` Moved manifest into new test utilities directory Moved schema test from `test/internal` into `internal/schemaversion`, and added `test/testutil/manifest` as an import dependency to get OS version. Removed internal from github actions testing Updated module paths to point to correct test folders Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
- run: go test -gcflags=all=-d=checkptr -v ./internal -tags admin | ||
working-directory: test |
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.
why this?
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.
The only file in test/internal
was a schemaversion test file, which I moved into the code library.
It was only ever in the test directory because it needed a manifest file to get the OS version, but with the manifest being moved out into testutil
, it can be imported into unit tests in the main code base without any issues
test/functional/main_test.go
Outdated
func getCtrdOptions() testutil.CtrdClientOptions { | ||
return testutil.CtrdClientOptions{ |
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.
can we just use the word containerd
here? Makes the distinction between this and the function above clearer.
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.
done
} | ||
|
||
// CreateWCOWUVMFromOpts creates a WCOW utility VM with the passed opts. | ||
func CreateWCOWUVMFromOpts(ctx context.Context, t *testing.T, _ *containerd.Client, opts *uvm.OptionsWCOW) *uvm.UtilityVM { |
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.
why do we pass through the client here if it's not used?
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.
Basically CreateWCOWUVMFromOptsWithImage
needs it, so I added it to all the functions here to maintain signature consistency, but I can remove it everywhere except for the two functions that need it.
Why is this a draft PR? |
Signed-off-by: Hamza El-Saawy <hamzaelsaawy@microsoft.com>
I am not sure if the code restructure will simplify things or make testing more difficult in the future, because of the potentially cyclic relationship between hcsshim tests and the tests dir. |
@helsaawy could we break anything out of this draft that we definitely want and PR those? |
Updated
./test/functional
to:ctr.exe
to find the layer path for imagesMoved out
utilities
andmanifest
from./test/functional
into./test/testutil
functional
andcri-containerd
testsMoved schema test from
test/internal
intointernal/schemaversion
,and added
test/testutil/manifest
as an import dependency to get OSversion. Removed internal from github actions testing
Updated module paths to point to correct test folders