Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testsys: Add support for a tests directory #2737

Merged
merged 7 commits into from
Feb 2, 2023

Conversation

ecpullen
Copy link
Contributor

Issue number:

Closes #

Description of changes:

dea965a8 testsys: Add userdata files to `tests`
b4228725 testsys: Enable test-type dependencies
2fd6b870 testsys: Allow configs in `test` table
874bd083 testsys: Eksctl config file support
1bb95e14 testsys: Support custom tests from `tests` dir
74295e5a testsys: kubeconfig and test config in tests dir
08411e14 testsys: Add `tests` to .gitignore

dea965a8 testsys: Add userdata files to 'tests'
Allow users to add files to the testsys directory either in tests/test_type, tests/shared, tests/shared/userdata

b4228725 testsys: Enable test-type dependencies
Allows a test type to provide configuration beyond an existing test type.

# Test.toml

[tests.configuration.foo]
# Tell TestSys that this is just another configuration of quick testing and the quick testing crds should be used.
test-type = "quick"
# Use `foo.toml` for userdata for this test type.
userdata = "foo"

2fd6b870 testsys: Allow configs in test table
Before, configurations had to be in a variant based table. Now configurations can also be present in the top level table.

874bd083 testsys: Eksctl config file support
Add support for eksctl config files.

# `tests/shared/cluster-config/basic-cluster.yaml`

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: "{{kube-arch}}-{{kube-variant}}-test"
  version: "{{version}}"
  region: "{{region}}"
kubernetesNetworkConfig:
  ipFamily: IPv4
vpc:
  clusterEndpoints:
    publicAccess: true
    privateAccess: true
iam:
  withOIDC: true
addons:
  - name: vpc-cni
    version: latest
  - name: coredns
    version: latest
  - name: kube-proxy
    version: latest
managedNodeGroups:
  - name: br-mng-{{kube-arch}}-{{kube-variant}}
    availabilityZones: []
    minSize: 0
    desiredCapacity: 0
    maxSize: 1
# Test.toml

[aws-k8s]
# TestSys will see that `basic-cluster.yaml` exists in `tests/shared/cluster-config` and use that in the crd. Since `existing-cluster.yaml` doesn't exist, it will handle `existing-cluster` without a cluster config.
cluster-names = ["basic-cluster", "existing-cluster"]

1bb95e14 testsys: Support custom tests from tests dir
A custom tests yaml configuration can be added to tests/<TEST_TYPE>/test.yaml (or a few other options)

74295e5a testsys: kubeconfig and test config in tests dir

Add support to Makefile.toml for Test.toml and testsys.kubeconfig in the tests directory or in the top level directory.

08411e14 testsys: Add tests to .gitignore

Add the tests directory to the projects .gitignore.

Testing done:

Tested various configurations of userdata, cluster config and custom test locations and verified that the correct file was used. Tested various nested configurations in Test.toml and verified that they were resolved properly.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Member

@webern webern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you improve the title of the PR. PR titles are important when sifting through changes for the changelog, etc.

@ecpullen ecpullen changed the title Testsys dir testsys: Add support for a tests directory Jan 18, 2023
Copy link
Contributor

@stmcginnis stmcginnis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally had a chance to read through some more. Everything looks good to me!

.gitignore Show resolved Hide resolved
Makefile.toml Outdated Show resolved Hide resolved
Makefile.toml Outdated Show resolved Hide resolved
tools/testsys/src/crds.rs Outdated Show resolved Hide resolved
tools/testsys/src/crds.rs Show resolved Hide resolved
@ecpullen ecpullen merged commit 9095648 into bottlerocket-os:develop Feb 2, 2023
@ecpullen ecpullen deleted the testsys-dir branch February 2, 2023 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants