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