Skip to content
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

Restores the bash e2e tests as a smoke test #183

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

maximilien
Copy link
Contributor

This should allow a set of small e2e tests that only use kn and do not depends on the e2e Golang code and other dependencies that it might create.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 12, 2019
@knative-prow-robot knative-prow-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 12, 2019
Copy link
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are there any plans to run those test for each PR, too ? Where would this need to be triggered ?

@maximilien
Copy link
Contributor Author

maximilien commented Jun 13, 2019

LGTM. Are there any plans to run those test for each PR, too ? Where would this need to be triggered ?

Great question. Was wondering that myself. Perhaps @adrcunha has some insights to share? I know he helped various times for infra scripts. Thx in advance.

@adrcunha
Copy link
Contributor

Get this merged, clone https://github.com/knative/test-infra/pull/908/files#diff-6b96213e43367b89ca71567c589995ed , run make config in ci/prow, include both files (config.yaml and config_knative.yaml) in a PR and send it to test-infra. Once that's merged and the job is up, set it as a required check in the master branch of this repo.

# Helper functions.

# Build kn before integration tests, so we fail fast in case of error.
function cluster_setup() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest doing what serving does, and move the common code (source, cluster_setup, knative_setup, initalize) into a e2e-common.sh file in a (near) future PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

kubectl create ns $KN_E2E_SMOKE_TESTS_NAMESPACE || fail_test

./kn service create hello --image gcr.io/knative-samples/helloworld-go -e TARGET=Knative -n $KN_E2E_SMOKE_TESTS_NAMESPACE || fail_test
sleep 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully soon this can be replaced with a proper checking, in order to avoid flakes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, with #54 (landing soon hopefully) we will have synchronous creation by default and don't need any sleep here.

@maximilien
Copy link
Contributor Author

maximilien commented Jun 13, 2019

Get this merged, clone https://github.com/knative/test-infra/pull/908/files#diff-6b96213e43367b89ca71567c589995ed , run make config in ci/prow, include both files (config.yaml and config_knative.yaml) in a PR and send it to test-infra. Once that's merged and the job is up, set it as a required check in the master branch of this repo.

Slight confusion here. The PR 908 (link) is merged. I cloned the test-infra repo and did as you suggested: run make config in ci/prow.

➜  prow git:(master) make config
go run make_config.go --prow-config-output="/Users/maximilien/Desktop/github/knative-test-infra/src/github.com/knative/test-infra/ci/prow//config.yaml" --testgrid-config-output="/Users/maximilien/Desktop/github/knative-test-infra/src/github.com/knative/test-infra/ci/prow//../testgrid/config.yaml" config_knative.yaml

The files have not changed... so perhaps I should skip this step.

@cppforlife
Copy link

cppforlife commented Jun 13, 2019

@sixolet i dont think these tests are useful especially since they do not assert on anything except an error code. if go e2e arent readable, we should fix that instead.

@adrcunha
Copy link
Contributor

@maximilien sorry about not being clear, I wrote that in a hurry. Don't worry about test-infra for now. When I wrote "clone 908" I meant the same kind of job needs to be added to the settings for the client repo so we have the presubmit. Once this PR is merged we can talk about it.

@rhuss
Copy link
Contributor

rhuss commented Jun 14, 2019

@sixolet i dont think these tests are useful especially since they do not assert on anything except an error code. if go e2e arent readable, we should fix that instead.

The (small) value I see here is that you call the command through a shell and not through exec (like in go's e2e). E.g. in the discussion about using wildcard patterns with kn there was the legitimate concern that wildcard expansion happens on the shell layer. That wouldn't be caught by exec based tests.

Said that maybe it would make more sense to extend the go based e2e tests to use a shell (if they not already do, sorry haven't checked that yet, but I doubt they do).

If it's not too expensive, having a simple test testing in one (or if we want to go over the top, with multiple) shell makes sense, as kn is supposed to be executed from within a shell. It's as close to the real thing as it gets.

test/e2e-smoke-tests.sh Outdated Show resolved Hide resolved
test/e2e-smoke-tests.sh Outdated Show resolved Hide resolved
test/e2e-smoke-tests.sh Outdated Show resolved Hide resolved
test/e2e-smoke-tests.sh Show resolved Hide resolved
@maximilien
Copy link
Contributor Author

/retest

@maximilien
Copy link
Contributor Author

OK I think the backend infra is failing miserably on all PRs tests... Istio failing here.

go: error loading module requirements
ERROR: cluster setup failed
***************************************
***         E2E TEST FAILED         ***

...
istio-system      6m26s       Warning   FailedMount                    Pod                       MountVolume.SetUp failed for volume "certs" : secrets "istio.istio-galley-service-account" not found

I'll attempt retesting later or tomorrow.

@adrcunha
Copy link
Contributor

No, the failure happens when building kn, in cluster_setup():

...
20170904100407-a1d1b6c41b1c
go: k8s.io/[email protected]: unknown revision v0.0.0
go: finding github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450
go: finding github.com/storageos/go-api v0.0.0-20180912212459-343b3eff91fc
go: finding github.com/golang/mock v0.0.0-20160127222235-bd3c8e81be01
go: finding github.com/gorilla/mux v1.7.0
go: error loading module requirements
ERROR: cluster setup failed
***************************************
***         E2E TEST FAILED         ***
***    Start of information dump    ***
***************************************

@adrcunha
Copy link
Contributor

/retest

@cppforlife
Copy link

Said that maybe it would make more sense to extend the go based e2e tests to use a shell (if they not already do, sorry haven't checked that yet, but I doubt they do).

im not quite clear what benefit we would be getting out of testing in bash vs exec-ing? user contract of the binary isnt changing based on the shell.

@rhuss
Copy link
Contributor

rhuss commented Jun 25, 2019

im not quite clear what benefit we would be getting out of testing in bash vs exec-ing? user contract of the binary isnt changing based on the shell.

E.g Wildcard expansion ? There are differences how arguments interpreted, shell vs. exec.

@sixolet
Copy link
Contributor

sixolet commented Jun 25, 2019

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 25, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maximilien, rhuss, sixolet

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 25, 2019
@knative-prow-robot knative-prow-robot merged commit d556df1 into knative:master Jun 25, 2019
@maximilien maximilien deleted the e2e-smoke-tests branch June 26, 2019 00:58
maximilien added a commit to maximilien/client that referenced this pull request Jul 1, 2019
coryrc pushed a commit to coryrc/client that referenced this pull request May 14, 2020
dsimansk added a commit to dsimansk/client that referenced this pull request Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants