Skip to content

Commit 0c10870

Browse files
committed
Fixed environment variable names depending on test implementation.
1 parent 1792a2a commit 0c10870

2 files changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/sqlx.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -534,20 +534,20 @@ jobs:
534534
- run: cargo build --features any,postgres,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }}
535535

536536
- run: |
537-
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
538-
docker exec postgres_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
537+
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_1_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
538+
docker exec postgres_1_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
539539
540540
- run: |
541-
docker compose -f tests/docker-compose.yml run -d -p 5433:5432 --name postgres_users_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
542-
docker exec postgres_users_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
541+
docker compose -f tests/docker-compose.yml run -d -p 5433:5432 --name postgres_2_${{ matrix.postgres }} postgres_${{ matrix.postgres }}
542+
docker exec postgres_2_${{ matrix.postgres }} bash -c "until pg_isready; do sleep 1; done"
543543
544544
- run: |
545-
docker compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_posts_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
546-
docker exec mysql_posts_${{ matrix.mysql }} bash -c "until mysqladmin ping; do sleep 1; done"
545+
docker compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_1_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
546+
docker exec mysql_1_${{ matrix.mysql }} bash -c "until mysqladmin ping; do sleep 1; done"
547547
548548
- run: |
549-
docker compose -f tests/docker-compose.yml run -d -p 3307:3306 --name mysql_comments_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
550-
docker exec mysql_comments_${{ matrix.mysql }} bash -c "until mysqladmin ping; do sleep 1; done"
549+
docker compose -f tests/docker-compose.yml run -d -p 3307:3306 --name mysql_2_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
550+
docker exec mysql_2_${{ matrix.mysql }} bash -c "until mysqladmin ping; do sleep 1; done"
551551
552552
# Create data dir for offline mode
553553
- run: mkdir .sqlx
@@ -560,9 +560,10 @@ jobs:
560560
--features any,postgres,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }}
561561
env:
562562
DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
563-
PG_USERS_DATABASE_URL: postgres://postgres:password@localhost:5433/sqlx
564-
MYSQL_POSTS_DATABASE_URL: mysql://root:password@localhost:3306/sqlx
565-
MYSQL_COMMENTS_DATABASE_URL: mysql://root:password@localhost:3307/sqlx
563+
PG_1_DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx
564+
PG_2_DATABASE_URL: postgres://postgres:password@localhost:5433/sqlx
565+
MYSQL_1_DATABASE_URL: mysql://root:password@localhost:3306/sqlx
566+
MYSQL_2_DATABASE_URL: mysql://root:password@localhost:3307/sqlx
566567
SQLX_OFFLINE_DIR: .sqlx
567568
RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" --cfg mysql_${{ matrix.mysql }}
568569

tests/mixed/test-attr.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ use sqlx::{MySqlPool, PgPool};
55
const PG_MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("tests/postgres/migrations");
66
const MYSQL_MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!("tests/mysql/migrations");
77

8-
const PG_USERS_DATABASE_URL: &'static str = "PG_USERS_DATABASE_URL";
9-
const MYSQL_COMMENTS_DATABASE_URL: &'static str = "MYSQL_COMMENTS_DATABASE_URL";
8+
const PG_2_DATABASE_URL: &'static str = "PG_2_DATABASE_URL";
9+
const MYSQL_2_DATABASE_URL: &'static str = "MYSQL_2_DATABASE_URL";
1010

1111
#[sqlx::test(
1212
env(migrations = "tests/postgres/migrations"), // no database url var
1313
env(
1414
migrator = "PG_MIGRATOR",
1515
fixtures(path = "fixtures/postgres", scripts("users")),
16-
var = "PG_USERS_DATABASE_URL", // rust path
16+
var = "PG_2_DATABASE_URL", // rust path
1717
),
1818
env(
1919
migrations = "tests/mysql/migrations",
2020
fixtures(path = "fixtures/mysql", scripts("posts")),
21-
var("MYSQL_POSTS_DATABASE_URL"), // string literal
21+
var("MYSQL_1_DATABASE_URL"), // string literal
2222
),
2323
env(
2424
migrator = "MYSQL_MIGRATOR",
2525
fixtures(path = "fixtures/mysql", scripts("comments")),
26-
var = "MYSQL_COMMENTS_DATABASE_URL", // rust path
26+
var = "MYSQL_2_DATABASE_URL", // rust path
2727
),
2828
)]
2929
async fn it_gets_from_invidual_environments(

0 commit comments

Comments
 (0)