bottlerocket icon indicating copy to clipboard operation
bottlerocket copied to clipboard

testsys: Add declarative testing through `Test.toml`

Open ecpullen opened this issue 2 years ago • 2 comments

Issue number:

Closes # N/A

Description of changes:

Enables configuring testing through Test.toml. There are now 5 levels of configuration.

# The test configuration is broken up into different levels depending on the variant.
# Each configuration's value will be selected in the following order:
# Arguments from the command line
# Environment variables from the command line
# '{variant}' configuration in `Test.toml`
# '{family}-{flavor}' configuration in `Test.toml`
# '{family}' configuration in `Test.toml`
# '{platform}-{flavor}' configuration in `Test.toml`
# '{platform}' configuration in `Test.toml`
# TestSys default values

Testing done: cargo make test works as expected with configured values.

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.

ecpullen avatar Aug 31 '22 20:08 ecpullen

^ Contains a large refactor of changes. Test.toml schema has been significantly changed to allow a more concise config.

ecpullen avatar Sep 15 '22 18:09 ecpullen

^ Fixes some rebasing issues and code cleanup.

ecpullen avatar Sep 21 '22 21:09 ecpullen

^ Address comments

  • Rework config_keys vec creation to be more idiomatic
  • Added comment to config_keys function
  • Removed commented MigrationsConfig
  • merge assign some variables before struct creation
  • 'uri' -> 'URI'
  • Removed unnecessary x86_64 table from 'Test.toml.example'
  • 'selected' -> 'precedence'
  • Provided configuration precedence for aws-k8s-1.23-nvidia variant on x86_64
  • Provided a sample cluster-names for ipv6 and ipv4 testing with a disclaimer that ipv6 cluster creation is not yet supported.
  • Changed e2e-repo-registry to conformance-registry to make it more general.
  • Changed kube-conformance-image to conformance-image to make it more general.
  • Reword cluster-names templated string comment.
  • Comments for unwrap()'s
  • Convert cluster_name to be &str to reduce cloning
  • Added debug log if no cluster templates were provided
  • Fixed inconsistencies with in user values

Still need to support multiple clusters with ecs.

ecpullen avatar Sep 22 '22 18:09 ecpullen

^ Enables ecs testing on multiple clusters and fixes an error in TestsysImages::new() Tested with cargo make -e BUILDSYS_VARIANT=aws-ecs-1 test with the following configuration.

[test]
repo="default"

[aws-ecs]
cluster-names = ["{{arch}}-{{variant}}", "{{arch}}-{{variant}}-dup"]

ecpullen avatar Sep 22 '22 19:09 ecpullen

^ Resolve merge conflict.

ecpullen avatar Sep 22 '22 19:09 ecpullen

^ Add small example config snippet to TESTING.md for instance type configuration.

ecpullen avatar Sep 22 '22 20:09 ecpullen

^ Update Test.toml.example's aws-k8s-1.23-nvidia hierarchy example to also show what configuration level is being represented.

ecpullen avatar Sep 22 '22 20:09 ecpullen

^ Fixed 2 outdated comments related to testing on multiple ECS clusters.

ecpullen avatar Sep 23 '22 19:09 ecpullen

^

  • Adds instance-types to example config file
  • Fixed typos in lib.rs
  • Remove lock support for Test.toml
  • Replace unwraps with expect

ecpullen avatar Sep 27 '22 16:09 ecpullen

^ Change generic S1 to S.

ecpullen avatar Sep 27 '22 16:09 ecpullen

^ Fix cargo fmt

ecpullen avatar Sep 27 '22 22:09 ecpullen

^ rebase to develop to fix merge conflict

ecpullen avatar Oct 13 '22 18:10 ecpullen

Does testsys.kubeconfig.eksctl.lock need to be deleted and .gitignored?

webern avatar Oct 13 '22 19:10 webern

^

  • Added testsys.kubeconfig.eksctl.lock to .gitignore
  • Change comment for kube_conformance_image
  • Convert .as_ref().cloned() to to_owned()
  • Reworded precedence comment in Test.toml.example
  • Added a note describing architecture configuration in Test.toml.example
  • Removed arguments from command line from precedence lists and added a not about them instead.
  • Changed Configurable fields to Configurable values
  • Added doc comment for reduced_config function
  • Added comments documenting the transformations occurring in reduced_config
  • Added doc comment for GenericConfig and GenericVariantConfig

ecpullen avatar Oct 13 '22 22:10 ecpullen

^

  • Remove eksctl.lock from history
  • Updated TESTING.md with comments
  • Added warning for use of default Test.toml
  • Used the proposed Test.toml.example
  • Replacedunwrap() with expect()

ecpullen avatar Oct 25 '22 18:10 ecpullen