-
Notifications
You must be signed in to change notification settings - Fork 277
tests/e2e: introduce e2e framework basics, first test #1801
Conversation
c02943e
to
aff9b70
Compare
- Adds first E2E helper framework and functions - Adds First test utilizing the framework - Added README.md Co-authored-by: Jon Huhn <jon.huhn@microsoft.com>
aff9b70
to
44a5fe2
Compare
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.
Left a few comments inline on the README, mostly nits and clarifying kind vs. non-kind. I didn't look at the actual code assuming that hasn't changed from what we've been working off of.
Overall I'd say this is ready for review.
tests/e2e/README.md
Outdated
|
||
The framework exposes an OSM test data structure or handle, which is in effect the interaction mechanism for the test itself. The test framework takes care to collect and initialize most of the common functionalities a test would expect when deploying on K8s, including but not limited to Kubernetes and SMI clientsets, flag parsing, container registry values, cleanup hooks, etc., and provides accessibility functions through the handle for the test to use at its own discretion. | ||
|
||
The hooks for initialization and cleanup are set at Ginkgo's `BeforeEach` at the top level of test execution (between Ginkgo `Describes`); we henceforth recommend keeping every test in its own `Describe` section, as well as on a separate file for clarity. You can refer to `suite_test.go` for more details. |
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.
I would love to hear others' opinions on how best to structure the tests (at least within each top-level Describe
block) and name them so they're easy to isolate.
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.
This seems reasonable. The BeforeEach
etc can be within the Describe
or Context
containers, so it seems ok that every e2e test be in its own Describe container.
Co-authored-by: Jon Huhn <nojnhuh@users.noreply.github.com>
Co-authored-by: Jon Huhn <jon.huhn@microsoft.com>
It will run separately as an individual gh action later
Codecov Report
@@ Coverage Diff @@
## main #1801 +/- ##
=======================================
Coverage 59.20% 59.20%
=======================================
Files 125 125
Lines 5170 5170
=======================================
Hits 3061 3061
Misses 2106 2106
Partials 3 3 Continue to review full report at Codecov.
|
SC2006: Use $(..) instead of legacy `..`.
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.
Thanks for this change, will test it out.
tests/e2e/README.md
Outdated
|
||
The framework exposes an OSM test data structure or handle, which is in effect the interaction mechanism for the test itself. The test framework takes care to collect and initialize most of the common functionalities a test would expect when deploying on K8s, including but not limited to Kubernetes and SMI clientsets, flag parsing, container registry values, cleanup hooks, etc., and provides accessibility functions through the handle for the test to use at its own discretion. | ||
|
||
The hooks for initialization and cleanup are set at Ginkgo's `BeforeEach` at the top level of test execution (between Ginkgo `Describes`); we henceforth recommend keeping every test in its own `Describe` section, as well as on a separate file for clarity. You can refer to `suite_test.go` for more details. |
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.
This seems reasonable. The BeforeEach
etc can be within the Describe
or Context
containers, so it seems ok that every e2e test be in its own Describe container.
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.
Tested this out, looks good.
args = append(args, fmt.Sprintf("--enable-grafana=%v", instOpts.deployGrafana)) | ||
args = append(args, fmt.Sprintf("--deploy-jaeger=%v", instOpts.deployJaeger)) | ||
|
||
stdout, stderr, err := td.RunLocal(filepath.FromSlash("../../bin/osm"), args) |
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.
Is there a path to also test helm install
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.
Not yet, but we have that scenario documented in our running list: #1714 (comment)
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.
As discussed offline, helm install
should be part of the test suite regardless of the scenarios we are testing. Added #1814 to track.
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.
When running this manually, my test passed but I was confused by the output. Would you mind explaining what is happening below and why I'm seeing the REST req failed messages? and what does the nil mean here:Delete for osm-system: <nil>
?
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 0) Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req failed (status: 404) <nil>
> REST req succeeded: 200
> REST req succeeded: 200
> REST req succeeded: 200
> REST req succeeded: 200
> REST req succeeded: 200
STEP: Deleting SMI policies
> REST req failed correctly: Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed correctly: Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed correctly: Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed correctly: Remote exec err: command terminated with exit code 7 | stderr:
> REST req failed correctly: Remote exec err: command terminated with exit code 7 | stderr:
[AfterEach] [Top Level]
/Users/michellenoorali/go/src/github.com/openservicemesh/osm/tests/e2e/suite_test.go:26
Deleting namespace client
Delete for client: <nil>
Deleting namespace server
Delete for server: <nil>
Deleting namespace osm-system
Delete for osm-system: <nil>
STEP: Waiting for namespaces [client server osm-system] to vanish
Deleting kind cluster: osm-e2e
I got similar feedback from @shashankram. I think we have a bit of misleading output on this first test, specifically and only because it was the first one, and we enabled a lot more verbosity on it when debugging. We can totally improve the way it is presented to avoid misleading information and straightforward understanding. |
@michelleN This will have to do for now til we get loggers and flags to enable log verbosity for specific parts of the test.
|
…h#1801) * E2E first commit - Adds first E2E helper framework and functions - Adds First test utilizing the framework - Added README.md Co-authored-by: Jon Huhn <jon.huhn@microsoft.com>
…h#1801) * E2E first commit - Adds first E2E helper framework and functions - Adds First test utilizing the framework - Added README.md Co-authored-by: Jon Huhn <jon.huhn@microsoft.com>
Co-authored-by: Jon Huhn jon.huhn@microsoft.com
Please answer the following questions with yes/no.
Yes
Yes, relevant sections have been commented with exact reference implementations that were used.