You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Flags can be combined, and their actions will take place in this order:
112
112
# --build, --up, --test, --down
@@ -187,11 +187,15 @@ if any specs are pending.
187
187
--ginkgo.focus="": If set, ginkgo will only run specs that match this regular
188
188
expression.
189
189
190
-
--ginkgo.noColor="n": If set to "y", ginkgo will not use color in the output
191
-
192
190
--ginkgo.skip="": If set, ginkgo will only run specs that do not match this
193
191
regular expression.
194
192
193
+
--ginkgo.label-filter="": If set, select tests based on their labels as described under
194
+
"Spec Labels" in https://onsi.github.io/ginkgo/#filtering-specs. This can focus
195
+
on tests and exclude others in a single parameter without using regular expressions.
196
+
197
+
--ginkgo.noColor="n": If set to "y", ginkgo will not use color in the output
198
+
195
199
--ginkgo.trace=false: If set, default reporter prints out the full stack trace
196
200
when a failure occurs
197
201
@@ -281,7 +285,7 @@ First, compile the E2E test suite with additional compiler flags
281
285
make WHAT=test/e2e/e2e.test GOGCFLAGS="all=-N -l" GOLDFLAGS=""
282
286
```
283
287
284
-
Then set the env var `E2E_TEST_DEBUG_TOOL=delve` and then run the test with `./hack/gingko.sh` instead of `kubetest`, you should see the delve command line prompt
288
+
Then set the env var `E2E_TEST_DEBUG_TOOL=delve` and then run the test with `./hack/ginkgo.sh` instead of `kubetest`, you should see the delve command line prompt
@@ -521,8 +525,10 @@ where `->` means upgrading; container_vm (cvm) and gci are image names.
521
525
522
526
## Kinds of tests
523
527
524
-
Tests can be labeled with any of the following labels, in order of increasing
525
-
precedence (that is, each label listed below supersedes the previous ones):
528
+
Tests can be labeled. Labels appear with square brackets inside the test names
529
+
(the traditional approach) *and* are Ginkgo v2 labels (since Kubernetes v1.29).
530
+
Available labels in order of increasing precedence (that is, each label listed
531
+
below supersedes the previous ones):
526
532
527
533
- If a test has no labels, it is expected to run fast (under five minutes), be
528
534
able to be run in parallel, and be consistent.
@@ -553,8 +559,12 @@ monitored closely in CI. `[Flaky]` tests are by default not run, unless a
553
559
554
560
- `[Feature:.+]`: If a test has non-default requirements to run or targets
555
561
some non-core functionality, and thus should not be run as part of the standard
556
-
suite, it receives a `[Feature:.+]` label, e.g. `[Feature:Performance]` or
557
-
`[Feature:Ingress]`. `[Feature:.+]` tests are not run in our core suites,
562
+
suite, it receives a `[Feature:.+]` label. This non-default requirement could
563
+
be some special cluster setup (e.g. `Feature:IPv6DualStack` indicates that the
564
+
cluster must support dual-stack pod and service networks) or that the test has
565
+
special behavior that makes it unsuitable for a normal test run (e.g.
566
+
`Feature:PerformanceDNS` marks a test that stresses cluster DNS performance
567
+
with many services). `[Feature:.+]` tests are not run in our core suites,
558
568
instead running in custom suites. If a feature is experimental or alpha and is
559
569
not enabled by default due to being incomplete or potentially subject to
560
570
breaking changes, it does *not* block PR merges, and thus should run in
@@ -575,21 +585,80 @@ to be eligible for this tag. This tag does not supersed any other labels.
575
585
- `[LinuxOnly]`: If a test is known to be using Linux-specific features
576
586
(e.g.: seLinuxOptions) or is unable to run on Windows nodes, it is labeled
577
587
`[LinuxOnly]`. When using Windows nodes, this tag should be added to the
578
-
`skip` argument.
588
+
`skip` argument. This is not using `[Feature:LinuxOnly]` because that
589
+
would have implied changing all CI jobs which skip tests with unknown
590
+
requirements.
579
591
580
592
- The following tags are not considered to be exhaustively applied, but are
581
593
intended to further categorize existing `[Conformance]` tests, or tests that are
582
594
being considered as candidate for promotion to `[Conformance]` as we work to
583
595
refine requirements:
584
596
- `[Privileged]`: This is a test that requires privileged access
585
-
- `[Internet]`: This is a test that assumes access to the public internet
586
597
- `[Deprecated]`: This is a test that exercises a deprecated feature
598
+
599
+
- For tests that depend on feature gates, the following are set automatically:
587
600
- `[Alpha]`: This is a test that exercises an alpha feature
588
601
- `[Beta]`: This is a test that exercises a beta feature
589
602
603
+
Conceptually, these are non-default requirements as defined above under
604
+
`[Feature:.+]`, but for historic reasons and the sake of brevity they don't
605
+
have that prefix when embedded intest names. They *do* have that prefix in the
606
+
Ginkgo v2 label, so use e.g. `--filter-label=Feature: containsAny Alpha`.
607
+
590
608
Every test should be owned by a [SIG](/sig-list.md),
591
609
and have a corresponding `[sig-<name>]` label.
592
610
611
+
## Selecting tests to run
612
+
613
+
See https://onsi.github.io/ginkgo/#filtering-specs for a general introduction.
614
+
615
+
Focusing on a specific test by its name is useful when interactively running
616
+
just one or a few related tests. The test name is a concatenation of multiple
617
+
strings. To get a list of all full test names, run:
618
+
619
+
```console
620
+
$ e2e.test -list-tests
621
+
The following spec names can be used with 'ginkgo run --focus/skip':
622
+
test/e2e/apimachinery/watchlist.go:41: [sig-api-machinery] API Streaming (aka. WatchList) [Serial] [Feature:WatchList] should be requested when ENABLE_CLIENT_GO_WATCH_LIST_ALPHA is set
623
+
test/e2e/apimachinery/flowcontrol.go:65: [sig-api-machinery] API priority and fairness should ensure that requests can be classified by adding FlowSchema and PriorityLevelConfiguration
624
+
test/e2e/apimachinery/flowcontrol.go:190: [sig-api-machinery] API priority and fairness should ensure that requests can't be drowned out (fairness)
625
+
...
626
+
```
627
+
628
+
Or within the Kubernetes repo:
629
+
630
+
```console
631
+
$ go test -v ./test/e2e -args -list-tests
632
+
The following spec names can be used with 'ginkgo run --focus/skip':
633
+
test/e2e/apimachinery/watchlist.go:41: [sig-api-machinery] API Streaming (aka. WatchList) [Serial] [Feature:WatchList] should be requested when ENABLE_CLIENT_GO_WATCH_LIST_ALPHA is set
634
+
...
635
+
```
636
+
637
+
The same works for other Kubernetes E2E suites, like `e2e_node`.
638
+
639
+
In Prow jobs, selection by labels is often simpler. See
640
+
[below]((#kinds-of-tests) for documentation of the different labels that are in
641
+
use. A full list of labels used by a specific E2E suite can be obtained with
642
+
`--list-labels`.
643
+
644
+
A common pattern is to run only tests which have no special cluster setup
645
+
requirements and are not flaky:
646
+
647
+
--filter-label='Feature: isEmpty &&!Flaky'
648
+
649
+
Feature owners have to ensure that tests excluded that way from shared CI
650
+
jobs are executed in dedicated jobs (more on CI below):
0 commit comments