Skip to content

173 flat env vars #4342

173 flat env vars

173 flat env vars #4342

Workflow file for this run

name: Run HTTP tests
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
push:
branches:
- develop
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
ENV_NAME: local
ENV_TYPE: local
D2E_RESOURCE_LIMIT: 1 # Use all the resources for GHA
# Run only one job per branch
concurrency:
group: ${{ github.head_ref || github.ref_name }}-http-tests # Run the latest push
cancel-in-progress: true # Cancel in progress jobs of the workflow of the branch
jobs:
check_file_changes:
runs-on: ubuntu-latest
if: (github.ref_name == 'develop' || contains('release/', github.ref_name) || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft ) # Should run if branch is develop/release/workflow_dispatch and doesnt have a PR
outputs:
changes: ${{ steps.file_changes.outputs.src }}
steps:
- uses: actions/checkout@v4
- uses: dorny/[email protected]
id: file_changes
with:
initial-fetch-depth: 1
filters: |
src:
- "functions/_shared/alp-libs/nodejs/**"
- "functions/analytics-svc/**"
- "functions/bookmark-svc/**"
- "functions/cdw-svc/**"
- "functions/mri-pa-config/**"
- "functions/mri-pg-config/**"
- "functions/query-gen-svc/**"
- "services/mri-db/**"
- ".github/workflows/http-tests.yml"
- "package.json"
- "docker-compose.yml"
run-http-tests:
needs: [check_file_changes]
if: (github.ref_name == 'develop' || contains('release', github.ref_name) || github.event_name == 'workflow_dispatch') || ( github.event_name == 'pull_request' && !github.event.pull_request.draft && needs.check_file_changes.outputs.changes == 'true' ) # Should run if branch is develop/release/workflow_dispatch and doesnt have a PR
runs-on: ubuntu-latest
timeout-minutes: 60
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
TESTSCHEMA: HTTP_${{github.run_id}}
isTestEnv: "true"
isHttpTestRun: "true"
DOCKER_TAG_NAME: "local"
steps:
- uses: actions/checkout@v4
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
- name: Load dotenv from 1password
uses: 1password/load-secrets-action@v2
id: op-load-secret
with:
export-env: true
env:
ENV__BASE_ALL__YML: op://${{ secrets.OP_VAULT_NAME }}/.env.base-all.yml/notesPlain # remove after flattening
ENV__BASE_LOCAL__YML: op://${{ secrets.OP_VAULT_NAME }}/.env.base-local.yml/notesPlain # switch to local after flattening
HANASERVER: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/SG_FQDN"
HDIPORT: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/DB Port"
HDIPW: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/Admin password"
HDIUSER: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/Admin user"
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
REGISTRY_PASSWORD: "op://${{ secrets.OP_VAULT_NAME }}/az-alpCR/password"
REGISTRY_USERNAME: "op://${{ secrets.OP_VAULT_NAME }}/az-alpCR/username"
TESTPORT: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/DB Port"
TESTSYSTEMPW: "op://${{ secrets.OP_VAULT_NAME }}/az-hn-db/Admin password"
- name: Print env vars
run: |
echo "DOCKER_TAG_NAME: ${DOCKER_TAG_NAME}"
echo "HDIPORT: ${HDIPORT}"
echo "HDIPW: ${HDIPW}"
echo "HDIUSER: ${HDIUSER}"
echo "HANASERVER: ${HANASERVER}"
echo "isHttpTestRun: ${isHttpTestRun}"
echo "isTestEnv: ${isTestEnv:-false}"
echo "TESTSCHEMA: ${TESTSCHEMA}"
- name: Install 1Password CLI
uses: 1password/install-cli-action@v1
- name: Get drivers from 1password
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
OP_VAULT_NAME: ${{ secrets.OP_VAULT_NAME }}
run: |
yarn internal get:drivers
- uses: actions/setup-node@v4
with:
node-version: "18.20.4"
- name: create .env.local for docker-compose in system services
env:
OP_VAULT_NAME: ${{ secrets.OP_VAULT_NAME }}
OVERWRITE: true
run: |
echo "${ENV__BASE_ALL__YML}" > .env.base-all.yml # remove after flattening
echo "${ENV__BASE_LOCAL__YML}" > .env.base-local.yml # switch to local after flattening
wc -l .env.base-all.yml .env.base-local.yml
# merge
DOTENV_FILE=.env.local
yq -o sh eval-all '. as $item ireduce ({}; . * $item ) | sort_keys(..)' .env.base-all.yml .env.base-local.yml > $DOTENV_FILE
source scripts/lib.sh
gen-tls-internal
set-cpu-limit
set-memory-limit
sed -i.bak "s/CDMDEFAULT/${TESTSCHEMA}/g" .env.local
# echo keys
cat .env.local | grep = | grep _ | awk -F= '{print "-",$1}'
- name: Setup Test DB
run: |
yarn --prefer-offline
yarn inittestdb
- name: Build system services
run: |
grep _LIMIT .env.${ENV_TYPE}
yarn build:dev
- name: Manipulate configuration
run: |
yq -i '.networks.alp.external=true' docker-compose.yml
- name: Create network for external to use
run: |
docker network create alp
- name: Get and set logto values
env:
ENV_TYPE: "local"
run: |
# HTTP tests use hana db, hence USE_DUCKDB and USE_CACHEDB must be false
# due to logic in analytics service getDBConnections
echo "USE_DUCKDB=false" >>.env.local
echo "USE_CACHEDB=false" >>.env.local
echo "NODE_ENV=production" >>.env.local
# Inject Logto Apps envs
echo "LOGTO__ALP_APP__CLIENT_ID='GlEUkUOlpdpKgl01BrEVR'" >> .env.local
echo "LOGTO__ALP_APP__CLIENT_ID=GlEUkUOlpdpKgl01BrEVR" >> $GITHUB_ENV # Intentional to not surround the value with single quotes
echo "LOGTO__ALP_APP__CLIENT_SECRET='2X2hFU4BiW44odwB0OwjtJoQxtX7E5'" >> .env.local
echo "LOGTO__ALP_SVC__CLIENT_ID='FcvGMfGsNm8QNdt9aCRuX'" >> .env.local
echo "LOGTO__ALP_SVC__CLIENT_SECRET='IoJRGVHm05P8B0XRmqLozdK2U7TN1p'" >> .env.local
echo "LOGTO__ALP_DATA__CLIENT_ID='zUkAG2MRaNmnMTWHBzlVb'" >> .env.local
echo "LOGTO__ALP_DATA__CLIENT_SECRET='vgkToG2nuxzRDU7yMhAHiz5m1VZgLk'" >> .env.local
yarn init:logto
- name: Start system services
run: |
yarn start:ci
echo "Waiting 120 secs for services to start..."
sleep 120
- name: Check status of docker containers
run: |
docker ps -a
- name: Login to logto and get Bearer token and sub
run: |
# Get sign in page
response=$(curl -ik "https://localhost:41100/oidc/auth?redirect_uri=https%3A%2F%2Flocalhost%3A41100%2Fportal%2Flogin-callback&client_id=$LOGTO__ALP_APP__CLIENT_ID&response_type=code&state=lbFDB1hcko&scope=openid%20offline_access%20profile%20email&nonce=Osptnuwqc47w&code_challenge=n6eqz8p8jj1L9Qu7pY2_GrWO7XyaQbWrcs54x9OAnPg&code_challenge_method=S256")
printf "%s\n" "$response"
# Extract cookies
interaction_cookie=$(printf "%s\n" "$response" | grep _interaction= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_sig_cookie=$(printf "%s\n" "$response" | grep _interaction.sig= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_resume_cookie=$(printf "%s\n" "$response" | grep _interaction_resume= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_resume_sig_cookie=$(printf "%s\n" "$response" | grep _interaction_resume.sig= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
logto_cookie=$(printf "%s\n" "$response" | grep _logto= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
# Sign in
response=$(curl -ik --request PUT 'https://localhost:41100/api/interaction' \
--header 'content-type: application/json' \
--header 'Referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}" \
--data '{
"event": "SignIn",
"identifier": {
"username": "admin",
"password": "Updatepassword12345"
}
}')
printf "%s\n" "$response"
# Submit sign in page
response=$(curl -ik --request POST 'https://localhost:41100/api/interaction/submit' \
--header 'accept: application/json' \
--header 'origin: https://localhost:41100' \
--header 'referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}")
printf "%s\n" "$response"
# Get session
response=$(curl -ik "https://localhost:41100/oidc/auth/$interaction_cookie" \
--header 'referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _interaction_resume=$interaction_resume_cookie; _interaction_resume.sig=$interaction_resume_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}")
printf "%s\n" "$response"
interaction_cookie=$(printf "%s\n" "$response" | grep _interaction= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_sig_cookie=$(printf "%s\n" "$response" | grep _interaction.sig= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_resume_cookie=$(printf "%s\n" "$response" | grep _interaction_resume= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
interaction_resume_sig_cookie=$(printf "%s\n" "$response" | grep _interaction_resume.sig= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
logto_cookie=$(printf "%s\n" "$response" | grep _logto= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
session_cookie=$(printf "%s\n" "$response" | grep _session= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
session_sig_cookie=$(printf "%s\n" "$response" | grep _session.sig= | awk -F'=' '{print $2}' | awk -F'; ' '{print $1}')
# Submit consent page
response=$(curl -ik 'https://localhost:41100/consent' \
--header 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
--header 'referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _interaction_resume=$interaction_resume_cookie; _interaction_resume.sig=$interaction_resume_sig_cookie; _session=$session_cookie; _session.sig=$session_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}")
printf "%s\n" "$response"
# Get authorization code
response=$(curl -ik "https://localhost:41100/oidc/auth/$interaction_cookie" \
--header 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
--header 'referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _interaction_resume=$interaction_resume_cookie; _interaction_resume.sig=$interaction_resume_sig_cookie; _session=$session_cookie; _session.sig=$session_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}")
printf "%s\n" "$response"
authorization_code=$(printf "%s\n" "$response" | sed -n 's/.*code=\([^&]*\).*/\1/p' | head -n 1)
# Complete login
response=$(curl -ik "https://localhost:41100/portal/login-callback?code=$authorization_code&state=lbFDB1hcko&iss=https%3A%2F%2Flocalhost%3A41100%2Foidc" \
--header 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' \
--header 'referer: https://localhost:41100/sign-in' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _interaction_resume=$interaction_resume_cookie; _interaction_resume.sig=$interaction_resume_sig_cookie; _session=$session_cookie; _session.sig=$session_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}")
printf "%s\n" "$response"
# Get Bearer token
response=$(curl -ik 'https://localhost:41100/oauth/token' \
--header 'accept: application/json, text/javascript, */*; q=0.01' \
--header 'content-type: application/x-www-form-urlencoded' \
--header "Cookie: _interaction=$interaction_cookie; _interaction.sig=$interaction_sig_cookie; _interaction_resume=$interaction_resume_cookie; _interaction_resume.sig=$interaction_resume_sig_cookie; _session=$session_cookie; _session.sig=$session_sig_cookie; _logto={\"appId\":\"$LOGTO__ALP_APP__CLIENT_ID\"}" \
--header 'origin: https://localhost:41100' \
--header 'referer: https://localhost:41100/portal/login-callback?code=2sxkx6uCahwOfKo1cwzLaAq5MfdBJrMcqCLNHvOTXFv&state=odSrnZhVyE&iss=https%3A%2F%2Flocalhost%3A41100%2Foidc' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode "client_id=$LOGTO__ALP_APP__CLIENT_ID" \
--data-urlencode 'redirect_uri=https://localhost:41100/portal/login-callback' \
--data-urlencode "code=$authorization_code" \
--data-urlencode 'code_verifier=kqVLhCyXRJ3Y9mXie6F9d1FW8AUbTUzIuJiqUf1SM9I')
printf "%s\n" "$response"
export BEARER_TOKEN=$(echo "$response" | grep -o '"access_token":"[^"]*"' | sed 's/"access_token":"\([^"]*\)"/\1/')
echo "BEARER_TOKEN=$BEARER_TOKEN" >> $GITHUB_ENV # Make available to subsequent github actions steps
echo "BEARER TOKEN:"
echo $BEARER_TOKEN
# Get the idp sub
decode_base64_url() {
local len=$((${#1} % 4))
local result="$1"
if [ $len -eq 2 ]; then
result="$1"'=='
elif [ $len -eq 3 ]; then
result="$1"'='
fi
echo "$result" | tr '_-' '/+' | openssl enc -d -base64
}
decode_jwt() {
decode_base64_url $(echo -n $2 | cut -d "." -f $1)
}
DECODED_TOKEN="$(decode_jwt 2 $BEARER_TOKEN)"
echo "DECODED TOKEN:"
echo $DECODED_TOKEN
export IDP_SUB=$(echo $(echo $DECODED_TOKEN | grep -o '"sub":"[^"]*"' | awk -F':' '{print $2}' | tr -d '"'))
echo "IDP_SUB=$IDP_SUB" >> $GITHUB_ENV # Make available to subsequent github actions steps
echo "IDP SUB:"
echo $IDP_SUB
# Endpoint to update user management with idp user id
response=$(curl -ik 'https://localhost:41100/usermgmt/api/user-group/list' \
-H 'accept: application/json, text/plain, */*' \
-H "authorization: Bearer $BEARER_TOKEN" \
-H 'content-type: application/json' \
-H 'origin: https://localhost:41100' \
-H 'referer: https://localhost:41100/portal/no-access' \
--data-raw "{\"userId\":\"$IDP_SUB\"}")
printf "%s\n" "$response"
USER_MGMT_ID=$(printf "%s\n" "$response" | grep -o '"userId":"[^"]*"' | awk -F':' '{print $2}' | tr -d '"')
echo "USER_MGMT_ID=$USER_MGMT_ID" >> $GITHUB_ENV # Make available to subsequent github actions steps
echo "USER_MGMT_ID:"
echo $USER_MGMT_ID
- name: Seed db credentials
run: |
echo "Seed db credentials"
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO db_credentials_mgr.db (id,host,port,name,dialect,created_by,created_date,modified_by,modified_date,code) VALUES
('9addef8a-56d1-42c2-bcad-3c10035d540b','${HANASERVER}',${HDIPORT},'ALPDEV','hana','local','2024-05-20 02:02:08.102165','local','2024-05-20 02:02:08.102165','${TESTSCHEMA}') ON CONFLICT DO NOTHING"
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO db_credentials_mgr.db_credential (username,\"password\",salt,service_scope,db_id,created_by,created_date,modified_by,modified_date,user_scope) VALUES
('TENANT_ADMIN_USER','izLc+XGmQCVy9p9Dkch/I8pKY19AtpBQXwM+dOa92mz9pJbwm5HedYIiewwvZAdoU/6RAdReWuLeGK+j9krWlZ1VNkiVDYbN9+GU3EM76gIyIEbttmd3H/A4XAlc157TWSgJruad3SK+aTavSfMp10G44xXQyoT1MZwIGf2HBljxt2AsMh25qalA/4zYVq2deuH8M7QkEwHxkgORH+rgWs7vIvg+RUSX/nJklCAioR1Kz/ue0H3ECWaXo55sc/pCaPs99ZUnKVqjUIVNPCkxNDfs/wh3E7/Q3mH6RE76ez5oa7pLzLgAAgzTR6sfNR/LFZkb/ngsUH20pmnat9SdJzLJSbrakZGaGXSvbPs4Dbx1NYTpDBgoMvhBVt5lJHyHrQSE+L3gg3JJOT+e/gBOULu9YSL53wQEYOFwkTaz65uyda0pXxlTjiwXeAAohkWM+Px/FIcP52/B+1HzVfynO4DJKdnK02w1B+vM2COW1ysT4nbmy4a5whDNtVxmDvC2lV9oz5x0xhZ/QjSRN/TbaDvOqCUdg2sDoBo4bxeFiCYrJFv2Ex7QJkKh3VZXgTE+qWZk4RyRYVLcRVFD4js8bBJ+RKMLcAmTJBtXIuotPQ3uMZEyq53dxbkF+CLvNQaCVoeDJQCHtYQU+NC32dQipT0F5hWdKK3r65cFs50Md8o=','GVB7oYGyiswVggS1uZm42Q==','Internal','9addef8a-56d1-42c2-bcad-3c10035d540b','local','2024-05-20 02:02:08.102165','local','2024-05-20 02:02:08.102165','Admin'),
('TENANT_READ_USER','Lh05IaOBUTrZpQ7iCsUsmoud0gKcBQGD0sNnppHInzElzZTpzEcCKlj5hdiHYCRWO4AFaS/slnwjbbAZvhoHSGYD1DqEoxZcL9G/Qk/7zH+2ntlPwMYlQKWGgKKLmPZ+M0fTRmo+kOsheF57hI2fPcBKJ5+MHBu9MlJb5E8MGlRXupY2kvIKwfj6FBGbz+2iiVBizmgbTkyF3d3q+qwMtmgit6M/hcl1vqPre2lA8zCRWQVA05ShO89nIIsP1aY37yrUZnsDFV50I1OgwQ7GKRJESLxkpoyipAvptYGTsPwNMFJuWiuqvT4pmk1pxzPj1svs2HhSGPQXhhOX+kLBSsdV3gGngjP/GibEv2vr2MrGijSF8cFdrNXUdVaodo3buqhbhi6AErAO6n385YaInL5OvHcNSY8vzBanpmLTzSBBhi0yabIwC3cpaJP8Uj+8z6YTHtQKiA3rsZfPeEUUUlEc9GerJUQWS6hYuleJAwo4fnybqfBO1svrz9EMtXyjAlmqpib3cusxKzfwH+HzsQpsiCAW0EF8FAA4PkYyXnMcWqZie/u1JEKrAO5fkCqgVYJOE9rsTs2EG0fMxvDICHzHwpOvrnabYwYH8fWUFlWltvPkEQZ8keyTAyhzLxFsqhNAtyydydkJBbzX6jDBe9yo7cPnhD3sYUWKHhG81Zs=','xdowTXu8Qkat5gTTj6URuA==','Internal','9addef8a-56d1-42c2-bcad-3c10035d540b','local','2024-05-20 02:02:08.102165','local','2024-05-20 02:02:08.102165','Read') ON CONFLICT DO NOTHING"
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO db_credentials_mgr.db_extra (service_scope,db_id,created_by,created_date,modified_by,modified_date,value) VALUES
('Internal','9addef8a-56d1-42c2-bcad-3c10035d540b','local','2024-05-20 02:02:08.102165','local','2024-05-20 02:02:08.102165', '{\"schema\": \"${TESTSCHEMA}\", \"useTLS\": false, \"encrypt\": false, \"pooling\": false, \"cdwSchema\": \"${TESTSCHEMA}\", \"autoCommit\": false, \"probeSchema\": \"${TESTSCHEMA}\", \"vocabSchema\": \"CDMVOCAB\", \"configSchema\": \"MRI\", \"sslTrustStore\": \"-----BEGIN CERTIFICATE-----MIIDuTCCAqGgAwIBAgIUX/oNqJTx15vT2SI6fg9bEInu3mAwDQYJKoZIhvcNAQELBQAwIDEMMAoGA1UEChMDU1JFMRAwDgYDVQQDEwdjYS1yb290MB4XDTIwMDkwODEzMzExOFoXDTMwMDkwNjEzMzE0N1owIDEMMAoGA1UEChMDU1JFMRAwDgYDVQQDEwdjYS1yb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArf7hNfOgoFzY/Cfk8XrRIq4eG6rsf7o8DZKMCoLnwR+uFtzCXyY8HWsD33Po6azXIaTqhT7JFO9osbK8JhzcgiIhxDLT5y5jx77AwKjqPWezgwuKutNAw2E8U5In+1i4mDwP1jJg2pXSoxUzKYQub03Zt04VzXhUD9HT8E8oON9TgQOFMP2+14zQ8VM1OtDLImOedSmyAtk34Tytu38ra1VRIWAkwz7G2O3O5Lsn2NvljLpSasR1Y3JALN1ePeegDr05mQXnNkRkYa4AutMhbfg+P1elCuJEVKfp+80IMnmJXXHwXXbPg6VqYzZkYZRbob2ESynjy7qUL6W/MJg6JwIDAQABo4HqMIHnMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSFTCgp1EHdFv14efJlS7Pl7xcZjzAfBgNVHSMEGDAWgBSFTCgp1EHdFv14efJlS7Pl7xcZjzA8BggrBgEFBQcBAQQwMC4wLAYIKwYBBQUHMAKGIGh0dHBzOi8vdmF1bHQuaHBzZ2MuZGUvdjEvcGtpL2NhMBIGA1UdEQQLMAmCB2NhLXJvb3QwMgYDVR0fBCswKTAnoCWgI4YhaHR0cHM6Ly92YXVsdC5ocHNnYy5kZS92MS9wa2kvY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQBMhvDhtbWPc8O65zV3I76ecpvIPUY6Rc8aHRRdNzUUu6EgyGnK/KHJ0v3+k5yxP2axbDzcviHcvU/zf64FHoM7j+ObcsfwrmtbD9ZyJUcE2vRyH8yFppnHHIQP1nmVjXzAxWLysnko5D3myLcK5CJzUaTCnAld2R6cj774MyekCytbN4U3VvMKfGBJ544tfMgAPPBGAfPEB6qDBw0S5cLD1tIrsikrx8FReQHU9r+yJl4uRjz4SY/397i9QdzQGlZPpWaw/3GCnBwJiEDCwZnSK14v62LwJVH97JvX4/a5YS+GQpIEwD6cC5Ru1dbCMYTYZAcEcPDJk0ldRnahn/5u-----END CERTIFICATE-----\", \"sslCryptoProvider\": \"sapcrypto\", \"rejectUnauthorized\": false, \"enableAuditPolicies\": false, \"validateCertificate\": false, \"hostnameInCertificate\": \"alp-hn-gold-sg.southeastasia.cloudapp.azure.com\"}') ON CONFLICT DO NOTHING"
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO db_credentials_mgr.db_vocab_schema (name,db_id,created_by,created_date,modified_by,modified_date) VALUES
('CDMVOCAB','9addef8a-56d1-42c2-bcad-3c10035d540b','local','2024-05-20 02:02:08.102165','local','2024-05-20 02:02:08.102165') ON CONFLICT DO NOTHING"
- name: Seed dummy dataset
run: |
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO portal.dataset (id,tenant_id,visibility_status,database_code,schema_name,token_dataset_code,\"type\",created_by,created_date,modified_by,modified_date,data_model,source_dataset_id,pa_config_id,vocab_schema_name,dialect) VALUES
('cd13fd3e-9f35-4812-b2a1-497b232a8771','e0348e4d-2e17-43f2-a3c6-efd752d17c23','DEFAULT','$TESTSCHEMA','CDMSYNPUF1K','HTTP_TEST_TOKEN','','$IDP_SUB','2024-03-26 09:59:19.539','$IDP_SUB','2024-03-26 09:59:19.539','DUMMY MODEL',NULL,'92d7c6f8-3118-4256-ab22-f2f7fd19d4e7','CDMVOCAB','hana') ON CONFLICT DO NOTHING"
docker exec alp-minerva-postgres-1 psql -h localhost -U postgres -p 5432 -d alp -c "INSERT INTO portal.dataset_detail (id,\"name\",description,summary,show_request_access,dataset_id,created_by,created_date,modified_by,modified_date) VALUES
('4988423f-a5f9-43c4-b6a2-04d02efb2d45','hanasynpuf1k','','',false,'cd13fd3e-9f35-4812-b2a1-497b232a8771','$IDP_SUB','2024-03-26 09:59:19.539','$IDP_SUB','2024-03-26 09:59:19.539') ON CONFLICT DO NOTHING"
curl -ik 'https://localhost:41100/usermgmt/api/user-group/register-study-roles' \
-H 'accept: application/json, text/plain, */*' \
-H "authorization: Bearer $BEARER_TOKEN" \
-H 'content-type: application/json' \
-H 'origin: https://localhost:41100' \
-H 'referer: https://localhost:41100/portal/systemadmin/dataset-overview' \
--data-raw "{\"userIds\":[\"$USER_MGMT_ID\"],\"tenantId\":\"e0348e4d-2e17-43f2-a3c6-efd752d17c23\",\"studyId\":\"cd13fd3e-9f35-4812-b2a1-497b232a8771\",\"roles\":[\"RESEARCHER\"]}"
- name: Install dependencies in backend integration tests
run: |
cd ./tests/backend_integration_tests
yarn
- name: Run HTTP tests
working-directory: ./tests/backend_integration_tests
run: yarn test-specs --test_schema_name=$TESTSCHEMA
- name: print logs for alp-cachedb
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-cachedb -t
- name: print logs for alp-dataflow-gen-1
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-dataflow-gen-1 -t
- name: print logs for alp-dataflow-gen-worker
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-dataflow-gen-worker -t
- name: print logs for alp-logto-1
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-logto-1 -t
- name: print logs for alp-minerva-postgres-1
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-minerva-postgres-1 -t
- name: print logs for alp-minerva-s3
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-minerva-s3 -t
- name: print logs for trex
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-trex -t
- name: print logs for alp-dataflow-gen-init-1
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-dataflow-gen-init-1 -t
- name: print logs for alp-minio-post-init
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-minio-post-init -t
- name: print logs for alp-minerva-pg-mgmt-init-1
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-minerva-pg-mgmt-init-1 -t
- name: print logs for alp-logto-post-init
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-logto-post-init-1 -t
- name: print logs for alp-logto-seed
if: ${{ always() || cancelled() || failure() }}
run: |
docker logs alp-logto-seed -t
- name: Remove Test DB
if: ${{ always() || cancelled() || failure() }}
run: yarn removetestdb
- name: Clean Docker compose
if: always()
run: |
# Clean DataNode services
# cd alp-data-node
yarn clean:minerva
docker network rm combined_network -f