Skip to content

Commit 57a0ce1

Browse files
committed
ci: debug e2e test redis setting
1 parent a73ffa8 commit 57a0ce1

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ jobs:
1515
POSTGRES_PASSWORD: truthypwd
1616
ports:
1717
- 5432:5432
18+
1819
redis:
1920
image: redis
2021
options: >-
2122
--health-cmd "redis-cli ping"
2223
--health-interval 10s
2324
--health-timeout 5s
2425
--health-retries 5
26+
ports:
27+
- 6379:6379
2528

2629
steps:
2730
- uses: actions/checkout@v2

test/factories/app.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,27 +114,16 @@ export class AppFactory {
114114
}
115115

116116
const setupRedis = async () => {
117-
const redis = new Redis({});
117+
const redis = new Redis({
118+
host: process.env.REDIS_HOST || 'localhost',
119+
port: parseInt(process.env.REDIS_PORT) || 6379
120+
});
118121
await redis.flushall();
119122
return redis;
120123
};
121124

122125
const setupTestDatabase = async () => {
123126
const database = `test_${uuid4()}`;
124-
console.log('🚀 ~ file: app.ts ~ line 124 ~ setupTestDatabase ~ database', {
125-
type: dbConfig.type,
126-
host: process.env.DB_HOST || dbConfig.host,
127-
port: parseInt(process.env.DB_PORT) || dbConfig.port,
128-
database: process.env.DB_DATABASE_NAME || dbConfig.database,
129-
username: process.env.DB_USERNAME || dbConfig.username,
130-
password: process.env.DB_PASSWORD || dbConfig.password,
131-
logging: false,
132-
synchronize: false,
133-
migrationsRun: true,
134-
migrationsTableName: 'migrations',
135-
migrations: [__dirname + '/../../src/database/migrations/**/*{.ts,.js}'],
136-
entities: [__dirname + '/../../src/**/*.entity{.ts,.js}']
137-
});
138127
const manager = new ConnectionManager().create({
139128
type: dbConfig.type,
140129
host: process.env.DB_HOST || dbConfig.host,

0 commit comments

Comments
 (0)