Skip to content

Add formatting query argument to list API (#251) #198

Add formatting query argument to list API (#251)

Add formatting query argument to list API (#251) #198

Workflow file for this run

name: Scenarios
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency: scenario
jobs:
scenarios:
name: Run scenario tests
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.23
id: go
- name: Install dependencies
run: |
cd scenarioTests
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Loading authentication file
run: |
cd scenarioTests
echo "${{ secrets.SCENARIO_TG_ANON_SESSION }}" | base64 -d > anon.session
- name: Starting Bot
env:
DB_TYPE: postgres
POSTGRES_HOST: localhost
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
BOT_API_KEY: ${{ secrets.SCENARIO_TG_BOT_API_KEY }}
run: |
echo "Installing dependencies..."
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
go run . > bot.log &
for i in 10 10 10 10 10 10 10 10 5 5 5 5; do
echo "=== Waiting for $i seconds for bot to start... ==="
sleep $i
if [[ "$(cat bot.log | wc -l)" -gt 3 ]]; then
echo "=== Bot started. Printing logs so far... ==="
cat bot.log
exit 0
fi
echo "=== Bot did not yet start. Log excerpt: ==="
tail -n 5 bot.log
done
echo "=== Bot did not start in time. Trying to run scenarios anyway... ==="
cat bot.log
- name: Run scenario tests
run: |
cd scenarioTests
TG_API_ID=${{ secrets.SCENARIO_TG_API_ID }} \
TG_API_HASH=${{ secrets.SCENARIO_TG_API_HASH }} \
TG_CHAT_ID=${{ secrets.SCENARIO_TG_CHAT_ID }} \
behave