-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for testcase groups. Merge test results of junit.xml file…
…s and e2e.log files.
- Loading branch information
1 parent
6fc278d
commit e75d150
Showing
22 changed files
with
809 additions
and
610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
kind: TestDefinition | ||
metadata: | ||
name: testgrid | ||
spec: | ||
owner: DL_5C5BE3E2970B9F404D0E2F50@sap.com | ||
recipientsOnFailure: | ||
- DL_5C5BE3E2970B9F404D0E2F50@sap.com | ||
|
||
description: Run kubernetes conformance tests and push result files (e2e.log and junit_01.xml) to testgrid repository. | ||
|
||
activeDeadlineSeconds: 10800 | ||
behavior: ["serial"] | ||
|
||
config: | ||
- type: env | ||
name: PUBLISH_RESULTS_TO_TESTGRID | ||
value: "true" | ||
- type: file | ||
name: GCLOUD_ACCOUNT_SECRET | ||
path: /tmp/secrets/gardener-logs-conformance-tests.json | ||
valueFrom: | ||
secretKeyRef: | ||
name: testgrid-gcs-secret | ||
key: gcloud.json | ||
- type: env | ||
name: TESTCASE_GROUPS | ||
value: 'conformance' | ||
- type: env | ||
name: GINKGO_PARALLEL | ||
value: "false" | ||
- type: env | ||
name: DESCRIPTION_FILE | ||
value: "working.json" | ||
|
||
command: [bash, -c] | ||
args: go run $GOPATH/src/github.com/gardener/test-infra/test/e2etest | ||
image: eu.gcr.io/gardener-project/gardener/testmachinery/base-step |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# E2E Test Runner | ||
|
||
The e2e test runner leverages kubetest to execute e2e tests and has a few additional features: | ||
|
||
- Define description files consisting of e2e testcases to run | ||
- Annotate testcases to run only for dedicated cloud providers | ||
- Evaluate test results of the kubetest run and provide elastic search documents | ||
|
||
## Usage | ||
|
||
Ensure all required environment variables have been set. Create a `shoot.config` file in `EXPORT_PATH` directory and paste the kubeconfig of the kubernetes cluster to test in it. Run `e2etest` in command line to execute the e2e tests. | ||
|
||
### Prerequisites: | ||
|
||
- Go installed | ||
- Git installed | ||
- (only for publishing results) environment variable `GCLOUD_ACCOUNT_SECRET` should point to a google cloud storage secret file | ||
|
||
### Parameters: | ||
|
||
| Environment Variable | Default | Description | | ||
|---|---|---| | ||
| DESCRIPTION_FILE | | **[Required]** Path to description json file, which lists the testcases to run | | ||
| K8S_VERSION | | **[Required]** Kubernetes cluster version | | ||
| TESTCASE_GROUPS | | **[Required]** testcases groups to run (comma separated). E.g. `fast,slow` | | ||
| CLOUDPROVIDER | | **[Required]** Cloud provider (supported: aws, gcp, azure, alicloud, openstack) | | ||
| EXPORT_PATH | /tmp/e2e/export | Location of `shoot.config` file and test results | | ||
| GINKGO_PARALLEL | true | Whether to run kubetest in parallel way. Testcases that consist of the `[Serial] tag are executed serially. | | ||
| IGNORE_FALSE_POSITIVE_LIST | false | Ignores exclusion of testcases that are listed in `false_positive.json` | | ||
| IGNORE_SKIP_LIST | false | Ignores exclusion of testcases that are listed in `skip.json` | | ||
| INCLUDE_UNTRACKED_TESTS | false | Executes testcases that are not mentioned in description files for given provider and kubernetes release version | | ||
| FLAKE_ATTEMPTS | 2 | Flake attempts for kubetest: how many time a failed test should be rerun | | ||
| PUBLISH_RESULTS_TO_TESTGRID | false | Whether to push test results to google cloud storage, for testgrid | | ||
| RETEST_FLAGGED_ONLY | false | Runs testcases with retest flag only. Value of `DESCRIPTION_FILE` is ignored | | ||
|
||
### Description Files | ||
Example: | ||
```json | ||
[ | ||
{ "testcase": "[k8s.io] Sysctls [NodeFeature:Sysctls] should reject invalid sysctls", "groups": ["slow", "conformance"], "only": ["aws", "gcp"], "retest": ["aws"], "comment": "Some comment"}, | ||
{ "testcase": "[k8s.io] Sysctls [NodeFeature:Sysctls] should support sysctls", "groups": ["slow"], "exclude": ["aws"]} | ||
] | ||
``` | ||
| Field | Description | | ||
|---|---| | ||
| testcase | testcase name. Can be a substring. All testcases that has this as substring will be executed | | ||
| groups | assigns the testcase to testcase groups | | ||
| only | will consider the testcase only for given cloud provider | | ||
| exclude | will not consider the tetscase for given cloud provider | | ||
| comment | is not evaluated in any way in code. Use only for additional information | | ||
| retest | testcase will be excluded from all general test runs for given providers. Testcases with retest flag can be executed by setting `RETEST_ONLY=true` | | ||
|
||
Existing description files: | ||
- `working.json` consists of all working e2e testcases separated in different groups | ||
- `skip.json` consists of testcases that are always skipped by kubetest due to reasons like: driver not supported, requires >1 nodes, etc. | ||
- `false_positive.json` consists of testcases that are failing because of different reasons like bad code, which makes sense to test with next kubernetes release version | ||
|
||
### Output | ||
You find the kubetest dump results (like e2e.log and junit_*.xml files) in the `/tmp/e2e/artifacts` directory. These artifacts are evaluated and stored as *.json files in the `EXPORT_PATH` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.