From 98b2615b61c6d7dfc7eb42b34659f851b7145c48 Mon Sep 17 00:00:00 2001 From: rafiramadhana Date: Tue, 19 Sep 2023 08:13:21 +0700 Subject: [PATCH] Update e2e test Update e2e test of use context. --- .github/workflows/e2e.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index d8b1223..59c5452 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -49,12 +49,22 @@ jobs: layerform config set-context test-cloud -t cloud --url https://demo.layerform.dev --email foo@bar.com --password strongpass layerform config set-context test-local -t local --dir test - - name: layerform config select-context + - name: layerform config use-context run: | # fails if command succeeds - ! layerform config select-context test-does-not-exist # context does not exist + ! layerform config use-context test-does-not-exist # context does not exist - layerform config set-context test-local -t local --dir test && layerform config select-context test-local + # switch context to test-local + layerform config use-context test-local + layerfrom get-contexts | tee usecontext + grep -E '^\*\s+test-local' usecontext + !grep -E '^\*\s+test-s3' usecontext + + # switch context to test-s3 + layerform config use-context test-s3 + layerfrom get-contexts | tee usecontext + !grep -E '^\*\s+test-local' usecontext + grep -E '^\*\s+test-s3' usecontext - name: Configure run: | @@ -73,7 +83,7 @@ jobs: grep 'No layer instances spawned' instances - name: Spawn instances - run: | + run: |` layerform spawn bar test_bar layerform spawn baz test_baz layerform spawn bar test_custom_foo --base foo=custom