mirror of
https://github.com/versity/versitygw.git
synced 2026-09-22 16:04:15 +00:00
The azurite workflow waited a hardcoded `sleep 40` for the gateway container to compile and start listening before running tests. The container cold-builds `versitygw` from source on every run via `CompileDaemon`, and as the codebase grew that build increasingly exceeded the 40s budget, so tests started against a port with nothing listening yet and failed with connection resets. Poll `http://127.0.0.1:7070/` with `curl` until it responds, bounded by a `timeout`, so the wait scales with actual build time instead of a stale constant.
39 lines
1.0 KiB
YAML
39 lines
1.0 KiB
YAML
name: azurite functional tests
|
|
permissions: {}
|
|
on: pull_request
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v7
|
|
with:
|
|
go-version: 'stable'
|
|
id: go
|
|
|
|
- name: Set up Docker Compose
|
|
run: |
|
|
docker compose -f tests/docker-compose.yml --env-file .env.dev --project-directory . up -d azurite azuritegw
|
|
|
|
- name: Wait for services to be ready
|
|
run: |
|
|
timeout 180 bash -c 'until curl -s -o /dev/null http://127.0.0.1:7070/; do sleep 2; done'
|
|
|
|
- name: Get Dependencies
|
|
run: |
|
|
go mod download
|
|
|
|
- name: Build and Run
|
|
run: |
|
|
make
|
|
./versitygw test -a user -s pass -e http://127.0.0.1:7070 full-flow --azure
|
|
|
|
- name: Shut down services
|
|
run: |
|
|
docker compose -f tests/docker-compose.yml --env-file .env.dev --project-directory . down azurite azuritegw
|