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

Create deployment framework for Terraform tests #47

Merged
merged 4 commits into from
Apr 9, 2024

Conversation

adriansuarez
Copy link
Collaborator

This change adds a framework for deploying NuoDB Control Plane instances in various configurations, and consolidates the CircleCI jobs that were previously known as integration_test and e2e_test.

The integration_test job was relying on the test-helper.tgz package that was published into the nuodb/nuodb-cp-releases repo. This has been replaced by KWOK, which is a tool for creating K8s clusters for test purposes. Unlike EnvTest, KWOK includes the controller-manager, which enables garbage collection and scheduling of workloads like Deployments and StatefulSets. This allows the simulated reconciliation logic that was previously being used to be replaced by real reconciliation logic being performed by an instance of the NuoDB Operator.

This change also decouples various aspects of the test environment that were previously conflated together based on the E2E_TEST environment variable. POD_SCHEDULING_ENABLED is used to skip tests that would take too long in a true end-to-end configuration, or inject configuration to speed up the test. WEBHOOKS_ENABLED is used to skip tests that exercise invalid configurations, which may be rejected by the server in a way that prevents us from achieving the desired Terraform test coverage.

This change adds a framework for deploying NuoDB Control Plane instances
in various configurations, and consolidates the CircleCI jobs that were
previously known as integration_test and e2e_test.

The integration_test job was relying on the test-helper.tgz package that
was published into the nuodb/nuodb-cp-releases repo. This has been
replaced by KWOK, which is a tool for creating K8s clusters for test
purposes. Unlike EnvTest, KWOK includes the controller-manager, which
enables garbage collection and scheduling of workloads like Deployments
and StatefulSets. This allows the simulated reconciliation logic that
was previously being used to be replaced by real reconciliation logic
being performed by an instance of the NuoDB Operator.

This change also decouples various aspects of the test environment that
were previously conflated together based on the E2E_TEST environment
variable. POD_SCHEDULING_ENABLED is used to skip tests that would take
too long in a true end-to-end configuration, or inject configuration to
speed up the test. WEBHOOKS_ENABLED is used to skip tests that exercise
invalid configurations, which may be rejected by the server in a way
that prevents us from achieving the desired Terraform test coverage.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It might be better to review this in split-mode (click the gear at the top of the page), since a lot of the content is just being replaced instead of changed.

Copy link
Collaborator

@sivanov-nuodb sivanov-nuodb left a comment

Choose a reason for hiding this comment

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

Looks great.

deploy/k8s/teardown.sh Outdated Show resolved Hide resolved
deploy/kwok/setup.sh Show resolved Hide resolved
deploy/kwok/setup.sh Show resolved Hide resolved
deploy/kwok/env.sh Outdated Show resolved Hide resolved
@@ -21,8 +22,53 @@ import (
"github.com/stretchr/testify/require"
)

func IsE2E() bool {
return os.Getenv("E2E_TEST") == "true"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We'll need to change how nuodb-dbaas-deploy executes the TF plugin tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for the reminder.

deploy/README.md Outdated Show resolved Hide resolved
deploy/k8s/resume-operator.sh Show resolved Hide resolved
Copy link
Contributor

@kontaras kontaras left a comment

Choose a reason for hiding this comment

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

I like the design.

Makefile Outdated Show resolved Hide resolved
deploy/k8s/check.sh Outdated Show resolved Hide resolved
@adriansuarez adriansuarez merged commit c157491 into main Apr 9, 2024
4 checks passed
@adriansuarez adriansuarez deleted the asuarez/use-kwok branch April 9, 2024 19:50
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.

3 participants