Skip to content

Introduce E2E tests #41

Introduce E2E tests

Introduce E2E tests #41

Workflow file for this run

name: E2E
on:
push:
branches: [ master ]
pull_request:
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
# defaults:
# run:
# working-directory: ./e2e
strategy:
matrix:
node-version: [18]
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: sbt
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: |
pushd e2e/docker
docker-compose up -d
popd
SECONDS=0
sleep 5
until curl http://localhost:22973/infos/self-clique
do
if (( SECONDS > 60 ))
then
echo "Alephium full node not working after 1 min..."
exit 1
fi
echo "Waiting..."
sleep 5
done
echo ""
echo "Alephium full node is up"
sleep 5
export BLOCKFLOW_HOST=127.0.0.1
export BLOCKFLOW_PORT=22973
export BLOCKFLOW_NETWORK_ID=4
export DB_NAME=postgres
sbt app/run &
sleep 60
until curl http://localhost:9090/infos
do
if (( SECONDS > 600 ))
then
echo "explorer-backend full node not working after 1 min..."
exit 1
fi
echo "Waiting..."
sleep 5
done
echo ""
echo "explorer-backend is up"
cd e2e
npm i
npm run test