diff --git a/README.md b/README.md index 2bab52b7..8f553520 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,8 @@ Afterwards, when cleanup is required, just set `DESTROY_MODE` to `DESTROY_ONLY` #### Integration Test Prerequisites - An env0 organization - An API Key -- A Github.com integrated template name `Github Integrated Template` for suite 004_template +- A Github.com integrated template name `Github Integrated Template` for https://github.com/env0/templates +- A Gitlab.com integrated template name `Gitlab Integrated Template` for https://gitlab.com/env0/gitlab-vcs-integration-tests ### Unit Testing #### How to run tests diff --git a/tests/integration/004_template/expected_outputs.json b/tests/integration/004_template/expected_outputs.json index e6adff21..ce5171e2 100644 --- a/tests/integration/004_template/expected_outputs.json +++ b/tests/integration/004_template/expected_outputs.json @@ -2,6 +2,6 @@ "tested2_template_type": "terraform", "tested2_template_name": "tested1", "tested2_template_repository": "https://github.com/env0/templates", - "tested1_template_repository": "https://gitlab.com/eran.elbaz/templates.git", + "tested1_template_repository": "https://gitlab.com/env0/gitlab-vcs-integration-tests.git", "tested2_template_path": "second" -} \ No newline at end of file +} diff --git a/tests/integration/004_template/main.tf b/tests/integration/004_template/main.tf index 65b5d52c..7246787a 100644 --- a/tests/integration/004_template/main.tf +++ b/tests/integration/004_template/main.tf @@ -1,8 +1,15 @@ # Github Integration must be done manually - so we expect an existing Github Template with this name - +# It must be for https://github.com/env0/templates - We validate that in the outputs data "env0_template" "github_template" { name = "Github Integrated Template" } +# Gitlab Integration must be done manually - so we expect an existing Gitlab Template with this name +# It must be for https://gitlab.com/env0/gitlab-vcs-integration-tests - the gitlab_project_id is still static +data "env0_template" "gitlab_template" { + name = "Gitlab Integrated Template" +} + resource "env0_template" "tested1" { name = "tested1" description = "Tested 1 description" @@ -20,9 +27,9 @@ resource "env0_template" "tested2" { name = "GitLab Test" description = "Tested 2 description - Gitlab" type = "terraform" - repository = "https://gitlab.com/eran.elbaz/templates.git" - token_id = "6be35256-b685-4e92-8f6b-a332f5832c06" - gitlab_project_id = 28713760 + repository = data.env0_template.gitlab_template.repository + token_id = data.env0_template.gitlab_template.token_id + gitlab_project_id = 32315446 path = var.second_run ? "second" : "misc/null-resource" retries_on_deploy = 3 retry_on_deploy_only_when_matches_regex = "abc" @@ -75,3 +82,4 @@ output "tested2_template_path" { data "env0_template" "tested3" { id = env0_template.tested1.id } +