Skip to content

[SDP-1380] Allow disbursement.verification_field to be empty #1950

[SDP-1380] Allow disbursement.verification_field to be empty

[SDP-1380] Allow disbursement.verification_field to be empty #1950

name: Integration Tests
on:
push:
branches:
- main
pull_request:
workflow_call: # allows this workflow to be called from another workflow
env:
USER_EMAIL: "sdp_user@stellar.org"
USER_PASSWORD: "mockPassword123!"
DISTRIBUTION_PUBLIC_KEY: ${{ vars.DISTRIBUTION_PUBLIC_KEY }}
DISTRIBUTION_SEED: ${{ vars.DISTRIBUTION_SEED }}
CHANNEL_ACCOUNT_ENCRYPTION_PASSPHRASE: ${{ vars.DISTRIBUTION_SEED }}
SEP10_SIGNING_PUBLIC_KEY: ${{ vars.SEP10_SIGNING_PUBLIC_KEY }}
SEP10_SIGNING_PRIVATE_KEY: ${{ vars.SEP10_SIGNING_PRIVATE_KEY }}
CIRCLE_API_KEY: ${{ vars.CIRCLE_API_KEY }}
CIRCLE_USDC_WALLET_ID: ${{ vars.CIRCLE_USDC_WALLET_ID }}
jobs:
e2e:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
platform:
- "Stellar-phone" # Stellar distribution account where receivers are registered with their phone number
- "Stellar-email" # Stellar distribution account where receivers are registered with their email
- "Circle-phone" # Circle distribution account where receivers are registered with their email
include:
- platform: "Stellar-phone"
environment: "Receiver Registration - E2E Integration Tests (Stellar)"
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV"
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone.csv"
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER"
- platform: "Stellar-email"
environment: "Receiver Registration - E2E Integration Tests (Stellar)"
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.STELLAR.ENV"
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_email.csv"
REGISTRATION_CONTACT_TYPE: "EMAIL"
- platform: "Circle-phone"
environment: "Receiver Registration - E2E Integration Tests (Circle)"
DISTRIBUTION_ACCOUNT_TYPE: "DISTRIBUTION_ACCOUNT.CIRCLE.DB_VAULT"
DISBURSEMENT_CSV_FILE_NAME: "disbursement_instructions_phone.csv"
REGISTRATION_CONTACT_TYPE: "PHONE_NUMBER"
environment: ${{ matrix.environment }}
env:
DISTRIBUTION_ACCOUNT_TYPE: ${{ matrix.DISTRIBUTION_ACCOUNT_TYPE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cleanup data
working-directory: internal/integrationtests/docker
run: docker compose -f docker-compose-e2e-tests.yml down -v
shell: bash
- name: Set GIT_COMMIT
run: echo "GIT_COMMIT=$(git rev-parse --short HEAD)$( [ -n "$(git status -s)" ] && echo "-dirty-$(id -u -n)" )" >> $GITHUB_ENV
- name: Build Docker Compose services with GIT_COMMIT
working-directory: internal/integrationtests/docker
run: docker compose -f docker-compose-e2e-tests.yml build --build-arg GIT_COMMIT=${GIT_COMMIT}
shell: bash
- name: Run Docker Compose for SDP, Anchor Platform, and TSS
working-directory: internal/integrationtests/docker
run: docker compose -f docker-compose-e2e-tests.yml up -d
shell: bash
- name: Install curl
run: sudo apt-get update && sudo apt-get install -y curl
shell: bash
- name: Create integration test data
run: |
docker exec e2e-sdp-api bash -c "./stellar-disbursement-platform integration-tests create-data"
shell: bash
- name: Restart Anchor Platform
run: |
docker restart e2e-anchor-platform
shell: bash
- name: Wait for Anchor Platform at both localhost:8080/health and localhost:8085/health
run: |
wait_for_server() {
local endpoint=$1
local max_wait_time=$2
SECONDS=0
while ! curl -s $endpoint > /dev/null; do
echo "Waiting for server at $endpoint to be up... $SECONDS seconds elapsed"
sleep 4
if [ $SECONDS -ge $max_wait_time ]; then
echo "Server at $endpoint is not up after $max_wait_time seconds."
exit 1
fi
done
echo "Server at $endpoint is up."
}
wait_for_server http://localhost:8080/health 120
wait_for_server http://localhost:8085/health 120
shell: bash
- name: Start integration test command
run: |
docker exec e2e-sdp-api bash -c "./stellar-disbursement-platform integration-tests start"
shell: bash
- name: Docker logs
if: always()
working-directory: internal/integrationtests/docker
run: docker compose -f docker-compose-e2e-tests.yml logs && docker compose -f docker-compose-e2e-tests.yml down
shell: bash