From 4c9cd640657663b4561748de3a5bbed13013a84c Mon Sep 17 00:00:00 2001 From: ce0la Date: Fri, 14 Jun 2024 14:57:27 +0100 Subject: [PATCH] Add SDK E2E Tests - Create shell script to generate .env file for workflow - Add new workflow definition for tests --- .github/workflows/test-deploy-e2e.yaml | 2 +- packages/e2e/src/scripts/generate-dotenv.sh | 52 +++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100755 packages/e2e/src/scripts/generate-dotenv.sh diff --git a/.github/workflows/test-deploy-e2e.yaml b/.github/workflows/test-deploy-e2e.yaml index ad9fc5d48a2..d7a3fc560ef 100644 --- a/.github/workflows/test-deploy-e2e.yaml +++ b/.github/workflows/test-deploy-e2e.yaml @@ -1,4 +1,4 @@ -name: CI/CD +name: Continuous Integration - SDK E2E on: workflow_dispatch: diff --git a/packages/e2e/src/scripts/generate-dotenv.sh b/packages/e2e/src/scripts/generate-dotenv.sh new file mode 100755 index 00000000000..6ee5bb1f54e --- /dev/null +++ b/packages/e2e/src/scripts/generate-dotenv.sh @@ -0,0 +1,52 @@ +#!/bin/bash +set -x +set -o + +environment="$1" + +case "$environment" in + "dev-mainnet") + url="https://dev-mainnet.lw.iog.io" + ;; + "dev-preprod") + url="https://dev-preprod.lw.iog.io" + ;; + "dev-preview") + url="https://dev-preview.lw.iog.io" + ;; + "staging-preprod") + url="https://staging-preprod.lw.iog.io" + ;; + *) + echo "Invalid environment: $environment. Valid options are: dev-mainnet, dev-preprod, dev-preview, and staging-preprod" + exit 1 + ;; +esac + +# Construct the environment file content +envFileContent=" +# Logger +LOGGER_MIN_SEVERITY=info + +# Key management setup - required by getWallet +KEY_MANAGEMENT_PROVIDER=inMemory + +# Providers setup - required by getWallet +ASSET_PROVIDER=http +ASSET_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +HANDLE_PROVIDER=http +HANDLE_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4011/\"}' +NETWORK_INFO_PROVIDER=http +NETWORK_INFO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +REWARDS_PROVIDER=http +REWARDS_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +TX_SUBMIT_PROVIDER=http +TX_SUBMIT_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +UTXO_PROVIDER=http +UTXO_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +STAKE_POOL_PROVIDER=http +STAKE_POOL_PROVIDER_PARAMS='{\"baseUrl\":\"$url:4000/\"}' +" + +# Write the environment file content to the specified file +echo "$envFileContent" > .env