Commit Graph

124 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
5b241820b7
Merge pull request #114417 from chendave/ginkgo_fix_spec
e2e: bring back total test spec for Ginkgo v2
2023-01-12 03:28:56 -08:00
Patrick Ohly
0c2c027ebc e2e: clean up listing
It doesn't make sense for the E2E framework to have command line options that
don't do anything because then all test suites built with the framework inherit
those options.

For -list-images and -list-conformance-tests the solution is to move the
implementation into the framework (-list-images) respectively move the flag
into test/e2e (-list-conformance-tests).

The placement was decided based on the observation that image patching is
common functionality while conformance testing is specific to one test suite.
2022-12-23 10:36:06 +01:00
Dave Chen
8fe3e8df46 e2e: bring back total test spec for Ginkgo v2
Bring back the number of test spec which was dropped earlier.
It's now available in the reporting node of `ReportBeforeSuite` by extracting
the number from report.PreRunStats.SpecsThatWillBeRun.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-12-22 10:44:01 +08:00
Kubernetes Prow Robot
020fb2eb77
Merge pull request #113538 from pohly/e2e-ginkgo-timeline
e2e: ginkgo timeline
2022-12-21 13:53:28 -08:00
Patrick Ohly
cbb6ea5ca4 e2e: remove deprecated SuppressProgressReporting
It's not needed anymore and ginkgo warns about it.
2022-12-21 07:55:07 +01:00
Hemant Kumar
6dd94f5663 Refactor mock tests in different files
Change code to use pointer for mock driver setup
2022-12-13 14:26:07 -05:00
Patrick Ohly
14db9d1f92 e2e dra: add test driver and tests for dynamic resource allocation
The driver can be used manually against a cluster started with
local-up-cluster.sh and is also used for E2E testing. Because the tests proxy
connections from the nodes into the e2e.test binary and create/delete files via
the equivalent of "kubectl exec dd/rm", they can be run against arbitrary
clusters. Each test gets its own driver instance and resource class, therefore
they can run in parallel.
2022-11-12 00:17:15 +01:00
Patrick Ohly
5a01a52b0c test: extend gomega to use YAML for API types
Some of our API types contain fields that get rendered very poorly by
gomega.format.Object because they contain lots of internal information, for
example CreationTimestamp. As a result, dumping full API object typically gets
truncated.

What we want is a representation that is a) multi-line (in contrast to the
stringer implemented by our types) and b) drops empty fields where it
was defined that this is okay.

The normal YAML representation fits that requirement. We just need to teach
gomega how and when to do that. This cannot be done for each type through a
generated GomegaString method (lots of code, additional dependency in public
API on YAML encoder), but it can be done inside tests by adding a formatting
handler (new gomega feature).
2022-10-28 15:43:48 +02:00
Patrick Ohly
5614a9d064 e2e framework: eliminate interim sub packages
The "todo" packages were necessary while moving code around to avoid hitting
cyclic dependencies. Now that any sub package can depend on the framework, they
are no longer needed and the code can be moved into the normal sub packages.
2022-10-06 08:16:47 +02:00
Patrick Ohly
802451b6ca e2e framework: move metrics gathering into sub package
This reduces the size of the test/e2e/framework itself. Because it does not
gather metrics data anymore by default, E2E test suites must set their
callbacks function or set the original one by importing
"k8s.io/kubernetes/test/e2e/framework/todo/metrics/init".
2022-10-06 08:16:47 +02:00
Patrick Ohly
b8d28cb6c3 e2e framework: move node helper code into sub package
This reduces the size of the test/e2e/framework itself. Because it does not
check nodes anymore by default, E2E test suites must set their own check
function or set the original one by importing
"k8s.io/kubernetes/test/e2e/framework/todo/node/init".
2022-10-06 08:16:47 +02:00
Patrick Ohly
c45a924c5e e2e framework: move dumping of information into sub package
This reduces the size of the test/e2e/framework itself. Because it does not
dump anything anymore by default, E2E test suites must set their own dump
function or set the original one by importing
"k8s.io/kubernetes/test/e2e/framework/debug/init".
2022-10-06 08:16:47 +02:00
Patrick Ohly
80d3cc3027 e2e: suppress progress messages for custom progress reporter
The custom progress reporter gets invoked via ginkgo.ReportAfterEach after each
test. The problem was that the e2e framework unconditionally enables Ginkgo's
-progress output which shows execution of all nodes, including this
ReportAfterEach. The effect were over 1000 lines of useless output at the start
of a test run while skipping disabled tests.

The solution is to tell Ginkgo that the ReportAfterEach isn't meant to be
reported.
2022-08-30 19:58:10 +02:00
Danielle
5b312246c8
Revert "e2e: Trim junit reporter to adapt with testgrid" 2022-08-03 15:45:09 +02:00
Dave Chen
5fcb8e5153 e2e: trim junit report for Spyglass
Including the full information for successful tests makes the resulting XML
file too large for the 200GB limit in Spyglass when running large jobs (like
scale testing).

Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
Co-authored-by: Dave Chen <dave.chen@arm.com>
2022-08-03 00:32:24 +08:00
Dave Chen
46a3954ba5 Migrate ProgressReporter to Ginkgo V2
Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:46:11 +08:00
Dave Chen
dd58016484 Implement DetailsReporter report within ReportAfterSuite
The change is needed to verify the conformance test spec, as this
is verified in `verify-conformance-yaml.sh`.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:46:11 +08:00
Dave Chen
857458cfa5 update ginkgo from v1 to v2 and gomega to 1.19.0
- update all the import statements
- run hack/pin-dependency.sh to change pinned dependency versions
- run hack/update-vendor.sh to update go.mod files and the vendor directory
- update the method signatures for custom reporters

Signed-off-by: Dave Chen <dave.chen@arm.com>
2022-07-08 10:44:46 +08:00
Shu Muto
f9954d02c4 Delete test/e2e/ui/ 2022-02-10 14:48:02 +09:00
Antonio Ojea
9723fbf3f1 conformance tests should have at least 2 untainted nodes 2021-11-10 16:32:30 +01:00
Nabarun Pal
d98b2dd2d6
generated: remove usage of go-bindata
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2021-06-29 19:16:48 +05:30
Nabarun Pal
68b334d02b
test: setup embedded file sources for manifests
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2021-06-29 19:16:46 +05:30
Davanum Srinivas
d9f82f7eba
Drop viper stuff in test/
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-04 09:38:22 -04:00
David Eads
c7911a384c remove pod presets 2020-09-14 09:24:40 -04:00
Aaron Crickenberger
28768166f5 decouple testfiles from framework
This drops testfiles.ReadOrDie and updated testfiles.Exists to return an
error, forcing the caller to decide whether to call framework.Fail or do
something else.

It makes for a slightly less friendly API, but also means the package is
decoupled from framework again, as per the comments at the top of the
file
2020-06-29 14:54:09 -07:00
Davanum Srinivas
d1c948acdc
Add support for listing conformance tests
we print yaml, so you can use yaml tools like `yq`:
```
e2e.test --list-conformance-tests | yq r - --collect *.testname
```

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-01 10:48:53 -04:00
Davanum Srinivas
8f3dfea11f
Add version flag to e2e.test 2020-03-07 18:33:02 -05:00
clarklee92
4d43e9e39b e2e: move funs of framework/viperconfig to e2e
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>
2019-12-31 16:42:30 +08:00
wojtekt
59533f0cd1 Remove deprecated scalability tests 2019-09-30 16:04:09 +02:00
whypro
69f48d87a4 Move flag parse to main func from init() 2019-09-17 19:30:24 +08:00
Kenichi Omichi
c76291b8d3 Move HandleFlags to e2e package
HandleFlags() was used at e2e package and it depends on sub e2e
framework "config" in core e2e framework. That was invalid dependency.
So this moves HandleFlags() to e2e package for simple dependency.
2019-08-16 16:43:50 +00:00
Patrick Ohly
b86a007057 e2e: avoid mandatory command line flags
Tests should never directly add to the global command line, because
some users of the tests might not want them there. For example,
options might only get set directly from a config file.

To achieve that, e2e/framework/config, e2e/framework/viperconfig, and
e2e/framework/test_context.go avoid using the global flag set and
instead expect to be told by the caller which flag set to use. Tests
that called flag directly either get updated or obsolete flags get
removed.

The exception is framework.HandleFlags, which as before directly
implements global command line handling.

This is a breaking change for test suites which do not use that
function (and only those): they now need to ensure that they copy
individual flags from tests. Because the RegisterCommonFlags prototype
has changed, test suite authors will notice due to the resulting
compilation errors.
2019-07-04 17:15:14 +02:00
Mikhail Mazurskiy
4ce1fb7d40
Cleanup math/rand package usage 2019-05-24 09:25:04 +10:00
Patrick Ohly
6644db9914 e2e/storage: testing of external storage drivers
It is useful to apply the storage testsuite also to "external" (=
out-of-tree) storage drivers. One way of doing that is setting up a
custom E2E test suite, but that's still quite a bit of work.

An easier alternative is to parameterize the Kubernetes e2e.test
binary at runtime so that it instantiates the testsuite for one or
more drivers. Some parameters have to be provided before starting the
test because they define configuration and capabilities of the driver
and its storage backend that cannot be discovered at runtime. This is
done by populating the DriverDefinition with the content of the file
that the new -storage.testdriver parameters points to.

The universal .yaml and .json decoder from Kubernetes is used. It's
flexible, but has some downsides:
- currently ignores unknown fields (see https://github.com/kubernetes/kubernetes/pull/71589)
- poor error messages when fields have the wrong type

Storage drivers have to be installed in the test cluster before
starting e2e.test. Only tests involving dynamically provisioned
volumes are currently supported.
2019-03-06 22:06:31 +01:00
Kubernetes Prow Robot
1d257d657c
Merge pull request #74829 from pohly/e2e-ginkgo
test/e2e: fix `ginkgo ./test/e2e`
2019-03-05 08:16:17 -08:00
Steve Sloka
6dc5494ec9 Refactor to allow for a way to get list of e2e images
Signed-off-by: Steve Sloka <slokas@vmware.com>
2019-03-01 17:15:19 -05:00
Patrick Ohly
ef6f3e0a18 test/e2e: fix ginkgo ./test/e2e
When running ginkgo directly against the source code of the test suite
instead of using some pre-compiled e2e.test binary, ginkgo no longer
recognized that it runs a Ginkgo testsuite, which broke "-focus" and
"-p".

By re-inserting the magic strings that ginkgo looks for into a
comment, we can restore the desired behavior without affecting the
code.

Fixes: #74827
2019-03-01 21:44:30 +01:00
andrewsykim
596c6fbf03 e2e test for node deleted in cloud provider 2019-01-25 17:45:18 -05:00
Vy Ta
28ed7875e7 Adding density test 2018-12-10 23:48:39 +00:00
Patrick Ohly
cf0dcc6ab2 e2e: clarify and enhance configuration support
Storing settings in the framework's TestContext is not something that
out-of-tree test authors can do because for them the framework is a
read-only upstream component. Conceptually the same is true for
in-tree tests, so the recommended approach is to define configuration
settings in the code that uses them.

How to do that is a bit uncertain. Viper has several
drawbacks (maintenance status uncertain, cannot list supported
options, cannot validate the configuration file). How to handle
configuration files is currently getting discussed for kubeadm, with
similar concerns about
Viper (https://github.com/kubernetes/kubeadm/issues/1040).

Instead of making a choice now for E2E, the recommendation is that
test authors continue to define command line flags as before, except
that they should do it in their own code and with better flag names.

But the ability to read options also from a file is useful, so
several enhancements get added:
- all settings defined via flags can also be read from a
  configuration file, without extra work for test authors
- framework/config makes it possible to populate a struct directly
  and define flags with a single function call
- a path and file suffix can be given to --viper-config (as in
  "--viper-config /tmp/e2e.json") instead of expecting the file in
  the current directory; as before, just plain "--viper-config e2e"
  still works
- if "--viper-config" is set, the file must exist; otherwise the
  "e2e" config is optional (as before)
- errors from Viper are no longer silently ignored, so syntax errors
  are detected early
- Viper support is optional: test suite authors who don't want
  it are not forced to use it by the e2e/framework
2018-10-05 14:22:18 +02:00
Patrick Ohly
212af1ac29 e2e: abstract access to additional files
The new test/e2e/framework/testfiles package makes it possible to
write tests that do not depend on a specific way of providing
additional test files at runtime. Such tests and the framework are
then more easily reused in other test suites.

In the test/e2e suite file access is enabled based on the existing
"repo-root" command line parameter and the built-in bindata. Tests
using the new API will first check for files under "repo-root" and
then fall back to the builtin data. This way, users of a test binary
can modify those files without having to rebuild the binary.

"repo-root" is still needed because at least some tests check for
additional files (secret.yaml, via ingress_utils.go) that are not part
of the upstream source code and thus may or may not be built into a
test binary.

Tests using bindata or repo-root directly get modified to use the new
API, or removed when they are obsolete: test/e2e/examples.go depended
on files that were removed in
https://github.com/kubernetes/kubernetes/pull/61246 and thus can no
longer be run in Kubernetes. Moving the tests to kubernetes/examples
is tracked in https://github.com/kubernetes/examples/issues/214.

The file removal did not break the automated E2E testing probably
because the tests are under the Feature:Example tag and thus not
enabled during normal CI runs.

Removing also the obsolete tests makes it simpler to rework the
"repo-root" setting because less code uses it.

Related-to: #66649 and #23987
2018-10-02 08:31:03 +02:00
Maru Newby
7ecf404fc6 Move multizone e2e to sig scheduling path 2018-01-25 08:42:16 -08:00
Kubernetes Submit Queue
4aec334c95 Merge pull request #51898 from guangxuli/federation_e2e_test
Automatic merge from submit-queue (batch tested with PRs 52768, 51898, 53510, 53097, 53058). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

migration of federation test

**What this PR does / why we need it**:

Migrate federation(multicluster) e2e test.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

Ref Umbrella issue #49161
Ref issue https://github.com/kubernetes/kubernetes/issues/50735

- Move `ubernetes_lite.go` to new created directory named **multicluster**.

**Special notes for your reviewer**:

**Release note**:
none

/cc @quinton-hoole
2017-10-06 13:16:37 -07:00
Gavin
0c4be04775 migration of federation test 2017-09-04 20:20:43 +08:00
guangxuli
43ea56a058 migrate sig-ui e2e test
rebase
2017-08-19 01:04:52 +08:00
Gavin
fc453826c7 move some e2e tests to SIG respectively
fix typo

include the servicecatalog package

add framework file

update golint failures
2017-08-16 14:34:50 +08:00
Jacob Simpson
cd57f1c869 Migrate sig-auth e2e tests.
**What this PR does / why we need it:** This PR adds [sig-auth] prefix to
workload e2e tests in accord to requirements of adding a SIG dashboard
to testgrid. Refer PR #48781 for guidelines.
2017-08-14 09:39:54 -07:00
Michael Taufen
20f68942d3 Add blank import for node tests 2017-08-08 09:05:23 -07:00
Kubernetes Submit Queue
3973605189 Merge pull request #49422 from crassirostris/logging-e2e-refactoring
Automatic merge from submit-queue (batch tested with PRs 49871, 49422, 49092, 49858, 48999)

Refactor logging e2e tests, add new checks

I split existing code into smaller files to simplify the review and future changes

Also, there are new tests for stackdriver logging:
- ingesting system logs from all nodes
- ingesting logs in json format
- ingesting logs in glog format
2017-08-01 23:35:51 -07:00
Mik Vyatskov
86a2ac9433 Refactor logging e2e tests, add new checks 2017-07-31 19:21:48 +02:00