-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great.
@@ -21,8 +22,53 @@ import ( | |||
"github.com/stretchr/testify/require" | |||
) | |||
|
|||
func IsE2E() bool { | |||
return os.Getenv("E2E_TEST") == "true" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder.
There was a problem hiding this 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.
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.