Skip to content

Commit

Permalink
Refactor dev db start (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanedirt committed Dec 26, 2024
1 parent d77c281 commit 9d1923d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 55 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/dotnet-e2e-admin-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ jobs:
- name: Start dev database
run: ./install.sh configure-dev-db start

- name: Wait for database to be up
run: |
timeout=30
while ! nc -z localhost 5433; do
if [ "$timeout" -le "0" ]; then
echo "Timed out waiting for database"
exit 1
fi
echo "Waiting for database to be available on port 5433..."
sleep 1
timeout=$((timeout-1))
done
- name: Ensure browsers are installed
run: pwsh src/Tests/AliasVault.E2ETests/bin/Debug/net9.0/playwright.ps1 install --with-deps

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/dotnet-e2e-client-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,6 @@ jobs:
- name: Start dev database
run: ./install.sh configure-dev-db start

- name: Wait for database to be up
run: |
timeout=30
while ! nc -z localhost 5433; do
if [ "$timeout" -le "0" ]; then
echo "Timed out waiting for database"
exit 1
fi
echo "Waiting for database to be available on port 5433..."
sleep 1
timeout=$((timeout-1))
done
- name: Ensure browsers are installed
run: pwsh src/Tests/AliasVault.E2ETests/bin/Debug/net9.0/playwright.ps1 install --with-deps

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/dotnet-e2e-misc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ jobs:
- name: Start dev database
run: ./install.sh configure-dev-db start

- name: Wait for database to be up
run: |
timeout=30
while ! nc -z localhost 5433; do
if [ "$timeout" -le "0" ]; then
echo "Timed out waiting for database"
exit 1
fi
echo "Waiting for database to be available on port 5433..."
sleep 1
timeout=$((timeout-1))
done
- name: Ensure browsers are installed
run: pwsh src/Tests/AliasVault.E2ETests/bin/Debug/net9.0/playwright.ps1 install --with-deps

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/dotnet-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,5 @@ jobs:
- name: Start dev database
run: ./install.sh configure-dev-db start

- name: Wait for database to be up
run: |
timeout=30
while ! nc -z localhost 5433; do
if [ "$timeout" -le "0" ]; then
echo "Timed out waiting for database"
exit 1
fi
echo "Waiting for database to be available on port 5433..."
sleep 1
timeout=$((timeout-1))
done
- name: Run integration tests
run: dotnet test src/Tests/AliasVault.IntegrationTests --no-build --verbosity normal
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- "5433:5432"
volumes:
- ./database/postgres-dev:/var/lib/postgresql/data:rw
- ./postgresql.conf:/etc/postgresql/postgresql.conf
- ./src/Databases/AliasServerDb/postgresql.conf:/etc/postgresql/postgresql.conf
environment:
- POSTGRES_DB=aliasvault
- POSTGRES_USER=aliasvault
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ configure_dev_database() {
printf "${YELLOW}> Development database is already running.${NC}\n"
else
printf "${CYAN}> Starting development database...${NC}\n"
docker compose -p aliasvault-dev -f docker-compose.dev.yml up -d
docker compose -p aliasvault-dev -f docker-compose.dev.yml up -d --wait --wait-timeout 60
printf "${GREEN}> Development database started successfully.${NC}\n"
fi
print_dev_db_details
Expand Down Expand Up @@ -1564,7 +1564,7 @@ configure_dev_database() {
printf "${YELLOW}> Development database is already running.${NC}\n"
else
printf "${CYAN}> Starting development database...${NC}\n"
docker compose -p aliasvault-dev -f docker-compose.dev.yml up -d
docker compose -p aliasvault-dev -f docker-compose.dev.yml up -d --wait --wait-timeout 60
printf "${GREEN}> Development database started successfully.${NC}\n"
fi
print_dev_db_details
Expand Down

0 comments on commit 9d1923d

Please sign in to comment.