Skip to content

Commit

Permalink
Add SDK E2E Tests
Browse files Browse the repository at this point in the history
- Create shell script to generate .env file for workflow
- Add new workflow definition for tests
  • Loading branch information
ce0la committed Jun 14, 2024
1 parent d582c23 commit 4c9cd64
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-deploy-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI/CD
name: Continuous Integration - SDK E2E

on:
workflow_dispatch:
Expand Down
52 changes: 52 additions & 0 deletions packages/e2e/src/scripts/generate-dotenv.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4c9cd64

Please sign in to comment.