From c2060e4919d113fbdcb126dabb40aab04f15f61d Mon Sep 17 00:00:00 2001 From: Claudia Beresford Date: Mon, 18 Oct 2021 10:20:30 +0100 Subject: [PATCH] Get e2e nightly action working - ensure TF metal create works - cleanup projects after e2e run - use the correct format for the terraform action - ensure TF outputs are correctly formatted. The TF wrapper included in the action manipulates stdout and stderr to make it compatible with use in action pipelines, but that unfortunately makes it a pain to work with if you are using the output elsewhere. --- .github/workflows/nightly_e2e.yml | 10 ++++++++-- test/e2e/infra/main.tf | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly_e2e.yml b/.github/workflows/nightly_e2e.yml index cee11a3a..b6923032 100644 --- a/.github/workflows/nightly_e2e.yml +++ b/.github/workflows/nightly_e2e.yml @@ -13,10 +13,16 @@ jobs: - uses: actions/setup-go@v2 with: go-version: '^1.16.2' - - uses: hashicorp-terraform@v1 + - uses: hashicorp/setup-terraform@v1 with: - terraform_version: 1.0.1 + terraform_version: 1.0.9 + terraform_wrapper: false - name: Run tests run: make test-e2e env: METAL_AUTH_TOKEN: ${{ secrets.METAL_AUTH_TOKEN }} + - name: Cleanup projects + uses: weaveworks/metal-janitor-action@b0373b3a6a8bb1e6573616040121c22ba230cdc8 + with: + metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} + project_names: 'quicksilver_e2e_1' diff --git a/test/e2e/infra/main.tf b/test/e2e/infra/main.tf index 4408d2ae..04541dfd 100644 --- a/test/e2e/infra/main.tf +++ b/test/e2e/infra/main.tf @@ -39,7 +39,7 @@ provider "metal" { } resource "metal_project" "quicksilver_e2e" { - name = "quicksilver_e2e" + name = "quicksilver_e2e_1" } resource "metal_project_ssh_key" "test" { @@ -68,7 +68,6 @@ resource "null_resource" "example_provisioner" { user = var.ssh_user port = var.ssh_port private_key = file(var.private_key_path) - agent = true } provisioner "file" { @@ -87,4 +86,4 @@ resource "null_resource" "example_provisioner" { # # copy the metadata file back to CWD, which will be tested # command = "scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${var.ssh_user}@${metal_device.web1.network.0}:/tmp/metadata metadata" # } -} \ No newline at end of file +}