Commit Graph

99 Commits

Author SHA1 Message Date
Davanum Srinivas
a1d157bf32
Add some missing flags
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-14 10:36:25 -04:00
Davanum Srinivas
be42dcfd73
re-organize remote e2e test to be pluggable
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2023-03-13 12:33:47 -04:00
Todd Neal
23f71f0eba refactor remote test running 2023-03-12 21:26:01 -05:00
David Porter
e001884594 test: Add some default flags ginkgo flags for node e2e
Add the following ginkgo flags for each node e2e similar to the
existing hack/ginkgo-e2e.sh script.

* --no-color, colors aren't rendered properly in prow and make examining
  the log in text editors more difficult, so let's disable them.
  `hack/ginkgo-e2e.sh` (used for kind e2e tests) also disables them
  already.
* -v, enable verbose logs. This is needed so we get more detailed info
  even when the tests pass. This is useful so we can compare successful
  runs to failed runs.

Signed-off-by: David Porter <david@porter.me>
2023-02-28 00:24:40 -08:00
David Porter
e9ecdf3534 test: Emit ginkgo log for each node e2e
When running multiple node e2e with multiple machine images, the tests
are run separately for each node. The final build log has all of the
results for each of the hosts combined together which make debugging the
log difficult. To make it easier, emit a log for each host that was run.
This log will be written to the results directory and uploaded as an
artifact in prow jobs.

Signed-off-by: David Porter <david@porter.me>
2023-02-28 00:21:34 -08:00
David Porter
0980f026c9 test: Remove tests argument from node e2e image config
This was never being used, the only config that used it was deleted in
https://github.com/kubernetes/test-infra/pull/26017 so we don't need
this anymore, so let's delete it.

Signed-off-by: David Porter <david@porter.me>
2023-02-28 00:21:03 -08:00
Sascha Grunert
85106dc327
Allow SSH e2e node base64 key injection
With the change of the CRI-O jobs to use butane, we now have a
verification for base64 data urls in place. This means that the
following URL is invalid:

```
data:text/plain;base64,GCE_SSH_PUBLIC_KEY_FILE_CONTENT
```

This means we have to pass valid base64 to the URL. To fix that, we now
allow to inject SSH key values with both, the
`GCE_SSH_PUBLIC_KEY_FILE_CONTENT` field and its base64 encoded variant.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2023-02-09 16:17:11 +01:00
Patrick Ohly
136f89dfc5 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-02-06 15:39:13 +01:00
Antonio Ojea
7f5ae1c0c1
Revert "e2e: wait for pods with gomega" 2023-02-06 12:08:22 +01:00
Patrick Ohly
222f655062 e2e: use error wrapping with %w
The recently introduced failure handling in ExpectNoError depends on error
wrapping: if an error prefix gets added with `fmt.Errorf("foo: %v", err)`, then
ExpectNoError cannot detect that the root cause is an assertion failure and
then will add another useless "unexpected error" prefix and will not dump the
additional failure information (currently the backtrace inside the E2E
framework).

Instead of manually deciding on a case-by-case basis where %w is needed, all
error wrapping was updated automatically with

    sed -i "s/fmt.Errorf\(.*\): '*\(%s\|%v\)'*\",\(.* err)\)/fmt.Errorf\1: %w\",\3/" $(git grep -l 'fmt.Errorf' test/e2e*)

This may be unnecessary in some cases, but it's not wrong.
2023-01-31 13:01:39 +01:00
Patrick Ohly
41619ace15 stop using deprecated klog flags
Some scripts and tools still relied on the deprecated flags, the ones
which are about to be removed.

This is intentionally not a complete removal of all those flags in the entire
repo. This would lead to much more code churn also in places where commands
still accept the flags because they use klog directly.
2022-09-04 21:02:43 +02:00
Davanum Srinivas
a9593d634c
Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-07-26 13:14:05 -04:00
Danielle Lancashire
0e0e3113e2 e2e_node: remote runner: Require containerd/crio 2022-04-20 16:49:29 +00:00
Sascha Grunert
57a3ce1a3e
Inject SSH public key into CRI-O serial prow jobs
This allows using the `GCE_SSH_PUBLIC_KEY_FILE_CONTENT` placeholder to
inject the public SSH key for running the tests.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-03-25 08:23:57 +01:00
ahrtr
fe95aa614c io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
Jonathan Lebon
3ebd93cd02 test-e2e-node: support pure SSH mode
Right now, `run_remote.go` only supports GCE instances. But actually
running the tests is completely independent of GCE and could work just
as well on any SSH-accessible machine.

This patch adds a new `--mode` switch, which defaults to `gce` for
backwards compatibility, but can be set to `ssh`. In that mode, the GCE
API is not used at all, and we simply connect to the hosts given via
`--hosts`.

This is still better than `run_local.go` because the latter mixes build
environment with test environment, which doesn't fit well with
container-optimized operating systems.

This is part of an effort to setup the e2e node tests on Fedora CoreOS
(see https://github.com/coreos/fedora-coreos-tracker/issues/990).

Patch best viewed with whitespace ignored.
2021-11-22 10:13:15 -05:00
Jonathan Lebon
591f4cdb77 run_remote.go: factor out prepareGceImages()
Mostly a pure code move. Only changed the `klog.Fatalf` to `fmt.Errorf`.
Prep for future patch.
2021-11-22 10:12:29 -05:00
Jonathan Lebon
032dbd2063 run_remote.go: move registerGceHostIP() call to testImage()
I.e. don't assume that `testHost` is called on a GCE host. Prep for
future patch.
2021-11-22 10:12:28 -05:00
Jonathan Lebon
36233b985b run_remote.go: factor out registerGceHostIP()
Prep for future patch.
2021-11-22 10:12:28 -05:00
Danielle Lancashire
4097a3d472 e2e_node: allow customizing the base kubeletconfig
This commit forces Kubelet Configuration files to always be generated
and when possible will use the kubeletconfig file that has been provided
by the test orchestrator
2021-11-02 15:09:56 +01:00
Danielle Lancashire
f1deb0ba2e e2e_node: remote: add kubeletconfig to archive
This commit enables the remote runner to provide a KubeletConfiguration
file to the test suite when uploading it to a remote host, thet test
runner will then use this configuration to run the Kubelet with the
provided config.
2021-11-02 15:08:39 +01:00
Danielle Lancashire
7dbbfe38e1 e2e_node: remote runner: junitFilePrefix -> junitFileName 2021-11-02 15:08:39 +01:00
Jordan Liggitt
322bc82777 Fix buffered signal channel go vet error 2021-08-20 16:47:56 -04:00
Kubernetes Prow Robot
fa152d25d8
Merge pull request #102209 from odinuge/node-e2e-fix
Ignore first SIGINT in node-e2e tests
2021-06-15 11:31:23 -07:00
Ed Bartosh
89284a1ba7 run_remote: improve error reporting
Included more info to the error message.
2021-06-10 14:34:05 +03:00
Odin Ugedal
c0c9f1f318
Ignore first SIGINT in node-e2e tests
Node e2e tests exceeding the global timeout are sent SIGINT, resulting
in no artifacts or console output. This will ignore the first SIGINT,
and since all children processes are being stopped due to SIGINT, we can
clean up before exiting.
2021-06-09 10:12:05 +02:00
Artyom Lukianov
93ff47b05b e2e node: make possible to add additional kernel arguments
Add an option to configure additional kernel arguments during
the setup of e2e node environment.

The example:
cos-stable1:
image_family: cos-89-lts # docker v19.03.6, deprecated after 2021-06-24
project: cos-cloud
metadata: "user-data<test/e2e_node/jenkins/cos-init-live-restore.yaml,gci-update-strategy=update_disabled"
kernel_arguments:
- "numa=fake=2"
machine: n1-standard-4

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-05-11 13:49:32 +03:00
Amim Knabben
0341e4c2f3 Enabling runtime config on E2E node tests 2021-03-08 15:45:06 -05:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Harshal Patil
2ad5f014a1 Add a check for crio service before starting node e2e tests
Signed-off-by: Harshal Patil <harpatil@redhat.com>
2020-09-18 18:09:54 +05:30
Sergey Kanzhelev
2baed83b5c remove stale TODO after this PR: #92204 2020-06-18 22:55:21 +00:00
Davanum Srinivas
01183e51f0
Check for either Docker or Containerd getting active for e2e_node tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-06-16 20:08:01 -04:00
Roy Yang
d79f0c6b39 Simplify the logic by removing dead code and enhance logging
Signed-off-by: Roy Yang <royyang@google.com>
2020-06-01 23:43:04 -07:00
Kubernetes Prow Robot
5592b5d67a
Merge pull request #91470 from MHBauer/fail-0-remote-images
explicitly fail if no images are found when running remote tests
2020-06-01 20:58:14 -07:00
Kubernetes Prow Robot
30eeacbf22
Merge pull request #91384 from alejandrox1/alejandrox1-patch-1
Added cadvisor test suite to flag info message
2020-05-26 16:48:56 -07:00
Morgan Bauer
58924c2de5
explicitly fail if no images are found when running remote tests
The previous implementation succeeds if no images are run. This causes
silent failures when image matchers are provided that do not match any image.
2020-05-26 14:08:27 -07:00
Jorge Alarcon Ochoa
a069eec2bb Added cadvisor test suite to flag info message
The cadvisor test suite is not mentioned in the remote runner's
`--test-suite` flag.
This PR will mention the existence of the cadvisor test suite.
2020-05-23 19:10:32 -04:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Odin Ugedal
c04ead5fb1
Add error check for instance insert
Not all errors will happen in sync during Instances.Insert(...).Do(), so
it is important to verify the operation object to see why insert fails.
An example is when exceeding the resource quota.

Eg.
could not create instance test-cos-beta-80-12739-29-0: [&{Code:QUOTA_EXCEEDED Location: Message:Quota 'CPUS' exceeded.  Limit: 24.0 in region europe-west6. ForceSendFields:[] NullFields:[]}

This fixes the issue where tests will fail "silently" when instance
insert fails.
2020-01-09 09:49:38 +01:00
tanjunchen
29eb15c3a8 fix golint check in test/e2e_node/runner/remote 2019-12-04 18:14:52 +08:00
SataQiu
69aae3aa5a fix golint failures of test/e2e_node/remote 2019-11-29 18:11:55 +08:00
Mike Danese
a4ca9e6c93 migrate callers to g/g/uuid 2019-11-04 23:15:29 -08:00
Kubernetes Prow Robot
946df1a914
Merge pull request #81932 from palnabarun/fix-staticcheck-tests-e2e_node
Fixes static check failures in test/e2e_node/*
2019-09-20 22:55:37 -07:00
Nabarun Pal
83c443e728
Fixes static check failures in test/e2e_node/* 2019-09-14 00:39:45 +05:30
Odin Ugedal
e20c2b1f32
Add support for preemptible instances in node-e2e
Preemptible instances are cheaper, and the small chanse of a vm being
killed doesn't matter when running during development. This is a
tradeoff the user should be able to decide on.

More info here:
https://cloud.google.com/compute/docs/instances/preemptible

The default setting is false, so unless setting
PREEMPTIBLE_INSTANCES=true, everything will behave as before.

Signed-off-by: Odin Ugedal <odin@ugedal.com>
2019-08-17 13:09:45 +02:00
Kubernetes Prow Robot
d1d6f64cda
Merge pull request #78198 from Random-Liu/node-e2e-service-account
Use default service account when creating test instance.
2019-05-22 20:06:23 -07:00
Lantao Liu
6bcad9cf71 Support image family in node e2e image config file.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-21 21:32:48 -07:00
Lantao Liu
cd33337ad9 Use default service account when creating test instance.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-05-21 21:09:04 -07:00
Zhen Wang
6df207bdaa allows configuring NPD image version in node e2e test and fix the test 2019-02-26 21:29:50 -08:00