Skip to content

chore: add integration test for provider #233

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

Merged
merged 7 commits into from
Jun 4, 2024

Conversation

johnstcn
Copy link
Member

This PR adds integration tests for the provider against an arbitrary version of Coder.

Example usage:

CODER_VERSION="v2.10.0-devel-3a9a7d199-amd64" go test -v ./integration

Testing methodology:

  • Create an ephemeral Coder instance running in a container
  • Perform initial setup
  • Import a predefined template that creates a single file
  • Create a workspace that populates the file with the actual output
  • Compare the actual versus expected output

@johnstcn johnstcn self-assigned this May 28, 2024
Copy link
Contributor

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

Looking super slick, added a few notes

@johnstcn johnstcn marked this pull request as ready for review May 29, 2024 09:17
}
}

// TODO: test coder_external_auth and coder_git_auth
Copy link
Member

Choose a reason for hiding this comment

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

coder_git_auth could be skipped as it has been deprecated for a while.

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

Nice testing improvement, so let's get it in.

@@ -0,0 +1,65 @@
terraform {
Copy link
Member

Choose a reason for hiding this comment

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

nit: curious if we can use a file from the examples directory, or put it there.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could use some, but most have dependencies like gcloud credentials that we can't necessarily provide.

@johnstcn
Copy link
Member Author

johnstcn commented Jun 4, 2024

Will add to GitHub testing workflow in a separate PR.

@johnstcn johnstcn merged commit df75712 into main Jun 4, 2024
12 checks passed
@johnstcn johnstcn deleted the cj/provider-integration-tests branch June 4, 2024 09:44
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants