-
Notifications
You must be signed in to change notification settings - Fork 820
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
Add a simple helm test #1449
Add a simple helm test #1449
Conversation
In Helm 3 there is an ability to use Batch Job instead of Pod in
We can add {{- if .Values.tests.enabled }} parameter as in this example https://github.com/hashicorp/consul-helm/blob/master/templates/tests/test-runner.yaml An example of a failed run (for example ImagePullBackoff on Agones Controller when used wrong imageTag):
Successful run:
|
Build Failed 😱 Build Id: 4c9454d0-19e1-4358-913d-9ce173188565 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build has failed because of absence of the image at the |
Build Failed 😱 Build Id: e614dd81-c296-408c-8e2f-a91899f954b2 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 51288b8b-a733-483b-9b35-8f1dc58fd868 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Failed 😱 Build Id: 270569e7-a5d1-4a0c-ab60-4fbf3f3afe75 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 8bec4e28-ea07-4bd2-bca5-a63a76c37614 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
LGTM, but probably should have some accompanying documentation? Probably in the Helm Installation section?
Yes, I will add this to the documentation. |
Gentle bump to add documentation. |
Build Succeeded 👏 Build Id: 6ec4292c-a58b-49fa-85cf-5bc0ea4a6b80 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: f700f771-8996-48a1-a680-46c2239da7f7 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
examples/crd-client/main.go
Outdated
fmt.Printf("New game servers' name is: %s", newGS.ObjectMeta.Name) | ||
if viper.GetBool(isHelmTest) { | ||
time.Sleep(1 * time.Second) | ||
err = agonesClient.AgonesV1().GameServers(defaultNs).Delete(newGS.ObjectMeta.Name, nil) // nolint: errcheck |
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.
remove // nolint: errcheck
examples/crd-client/main.go
Outdated
time.Sleep(1 * time.Second) | ||
err = agonesClient.AgonesV1().GameServers(defaultNs).Delete(newGS.ObjectMeta.Name, nil) // nolint: errcheck | ||
if err != nil { | ||
panic(err) |
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.
It is better to use panic from logrus here and above
examples/crd-client/main.go
Outdated
viper.SetDefault(gameServerImage, defaultImage) | ||
runtime.Must(viper.BindEnv(gameServerImage)) | ||
viper.GetString(gameServerImage) | ||
|
||
pflag.Bool(isHelmTest, false, "Is helm test - shutdown GameServer at the end of test. Defaults to false") |
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 rephrase - "Defines whether GameServer should be shut down at the end of the test or not"?
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.
added your definition.
Fail in C# SDK conformance test:
|
d025a61
to
308cb54
Compare
Build Succeeded 👏 Build Id: 3bc82ec1-3569-4043-bf18-c096e606d567 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: dc3f378e-ff2a-4f55-ae36-7008b4e15f52 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
Overall nice addition, just one thing to fixup I think.
examples/crd-client/main.go
Outdated
gameServerImage = "GAMESERVER_IMAGE" | ||
gameServerImage = "GAMESERVER_IMAGE" | ||
isHelmTest = "IS_HELM_TEST" | ||
gameserversNamespace = "GAMESERVERS_NAMESPACE" | ||
|
||
defaultImage = "gcr.io/agones-images/udp-server:0.19" |
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.
What was the motivation for hardcoding the image here? You were getting it as an environment variable, and it looks like you are still passing it in from the yaml below.
Seems like an env/arg value would be more flexible long term?
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.
Sorry, that was meant to be a comment, not an approval
This could be useful for Terraform configs check that installation was completed, for example after switching to a new cluster.
Described `helm test` command. Updated `crd-client` docs and version in yaml of example Job which creates a GameServer and also used by the test. Bump version of Agones in go.mod.
Build Succeeded 👏 Build Id: c5ff164d-c7e0-4869-addf-2a90ef25fa77 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Succeeded 👏 Build Id: 5bc3e8e5-e14a-4fdf-9898-41807252e931 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
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.
Nice!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akremsa, aLekSer, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: 908f4e44-1e46-4e6b-a4e0-824ffb365f80 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
* Add a simple helm test This could be useful for Terraform configs check that installation was completed, for example after switching to a new cluster. * Add docs, import cleanup. Described `helm test` command. Updated `crd-client` docs and version in yaml of example Job which creates a GameServer and also used by the test. Bump version of Agones in go.mod. Co-authored-by: Mark Mandel <[email protected]>
* Add a simple helm test This could be useful for Terraform configs check that installation was completed, for example after switching to a new cluster. * Add docs, import cleanup. Described `helm test` command. Updated `crd-client` docs and version in yaml of example Job which creates a GameServer and also used by the test. Bump version of Agones in go.mod. Co-authored-by: Mark Mandel <[email protected]>
This could be useful for Terraform configs check that installation
was completed, for example after switching to a new cluster.
Run
helm test agones --cleanup
to verify the deployment.