Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: enable terraform provisioners in e2e by default#13134

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 24 commits intomainfromstevenmasley/tf_e2e
May 8, 2024

Conversation

Emyrk
Copy link
Member

@EmyrkEmyrk commentedMay 2, 2024
edited
Loading

Opt out supported for "lite" tests. Environment checking happens
to verify terraform + docker exist before running.

The error if you are missingdocker (orterraform):

/bin/sh: line 1: docker: command not foundError: Terraform provisioners require docker & terraform. At least one of these is not present in the runtime environment. To check yourself:        $ terraform --version        $ docker --version

Closes#12821

@EmyrkGraphite App
Copy link
MemberAuthor

Emyrk commentedMay 2, 2024
edited
Loading

This stack of pull requests is managed by Graphite.Learn more about stacking.

Join@Emyrk and the rest of your teammates onGraphiteGraphite

@EmyrkEmyrkforce-pushed thestevenmasley/mem_provisioner branch fromda51c9b to487f0a8CompareMay 2, 2024 23:15
@EmyrkEmyrkforce-pushed thestevenmasley/tf_e2e branch fromc9cd564 to9064a9cCompareMay 2, 2024 23:15
Base automatically changed fromstevenmasley/mem_provisioner tomainMay 3, 2024 15:14
@EmyrkEmyrkforce-pushed thestevenmasley/tf_e2e branch from4407314 tof4d7c0dCompareMay 3, 2024 15:55
@EmyrkEmyrk changed the titlechore: terraform provisioners enabled in e2e by defaultchore: enable terraform provisioners in e2e by defaultMay 3, 2024
Comment on lines -225 to +227
"typescript.tsdk": "./site/node_modules/typescript/lib"
"typescript.tsdk": "./site/node_modules/typescript/lib",
// Playwright tests in VSCode will open a browser to live "view" the test.
"playwright.reuseBrowser": true
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is required to run a "live" debugger in VSCode with the chrome window open the whole time. Otherwise the window keeps opening and closing for each snapshot step.

Comment on lines +162 to +166
// StarterTemplates are ids of starter templates that can be used in place of
// the responses payload. These starter templates will require real provisioners.
export enum StarterTemplates {
STARTER_DOCKER = "docker",
}
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

We should probably add ways to add more to the templates later. For now, just using the starter template is easier.

Comment on lines +42 to +44
// Disabling terraform tests is optional for environments without Docker + Terraform.
// By default, we opt into these tests.
export const requireTerraformTests = !process.env.CODER_E2E_DISABLE_TERRAFORM;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I want to include this option if the Terraform stuff ever gets a bit messy. Right now for example docker containers are leaky.

Comment on lines +154 to +157
test.skip(
true,
"creating docker containers is currently leaky. They are not cleaned up when the tests are over.",
);
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I want to resolve this in another PR. Terraform provisioners are now working, just need to do some cleanup before I allow this test into the mainstage.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Tracked here:#13163

@EmyrkEmyrk marked this pull request as ready for reviewMay 3, 2024 17:19
// Will assume the query param has a valid ProvisionerType, as this query param is only used
// in testing.
defaultInitialValues.provisioner_type =
(searchParams.get("provisioner_type") as ProvisionerType) || "terraform";
Copy link
Member

Choose a reason for hiding this comment

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

I'd kind of rather leave this as astring, because we're not doing any validation on it, so it could be anything

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

You mean makeprovisioner_type a string?

Copy link
Member

Choose a reason for hiding this comment

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

I think the.get here returnsstring | undefined, and the|| narrows it tostring, but I think the cast here narrow it more than it should, basically. we don't actually know that the returned value is a validProvisionerType here because we didn't check!

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yes, that is correct. The type of thedefaultInitialValues.provisioner_type isProvisionerType which I would like to keep. Essentially I think adding validation is probably the best approach, but since this is a hidden query param only used in testing, I just skipped it for now. The BE will return a validation error if someone discovers this and tries to do something unsupported.

Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

thanks for addressing things! nothing worth blocking over anymore

@EmyrkEmyrk merged commita4bd50c intomainMay 8, 2024
@EmyrkEmyrk deleted the stevenmasley/tf_e2e branchMay 8, 2024 18:34
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 8, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@aslilacaslilacaslilac approved these changes

Assignees

@EmyrkEmyrk

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Add ane2e test that uses a real TF provisioner
2 participants
@Emyrk@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp