File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
memory-api/src/test/java/com/memory/controller Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 2121 distribution : ' temurin'
2222 cache : gradle
2323
24+ - name : Check Docker availability
25+ run : |
26+ docker --version
27+ docker info
28+
29+ - name : Make gradlew executable
30+ run : chmod +x ./gradlew
31+
2432 - name : Run memory-api tests with coverage
25- run : ./gradlew :memory-api:test :memory-api:jacocoTestReport
33+ run : ./gradlew :memory-api:test :memory-api:jacocoTestReport --info --stacktrace
34+ env :
35+ SPRING_PROFILES_ACTIVE : test
36+ TESTCONTAINERS_RYUK_DISABLED : true
37+ TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE : /var/run/docker.sock
2638
2739 - name : Upload coverage reports to Codecov
2840 uses : codecov/codecov-action@v3
Original file line number Diff line number Diff line change 11package com .memory .controller ;
22
33import org .testcontainers .containers .PostgreSQLContainer ;
4+ import org .testcontainers .containers .wait .strategy .Wait ;
45import org .testcontainers .utility .DockerImageName ;
56
7+ import java .time .Duration ;
8+
69public class PostgresTC extends PostgreSQLContainer <PostgresTC > {
710 private static final DockerImageName IMG = DockerImageName .parse ("postgis/postgis:15-3.3" )
811 .asCompatibleSubstituteFor ("postgres" );
@@ -13,10 +16,16 @@ private PostgresTC() {
1316 withDatabaseName ("memory_test" );
1417 withUsername ("test" );
1518 withPassword ("test" );
16- // 필요하면 .waitingFor(Wait.forListeningPort());
19+ withStartupTimeout (Duration .ofMinutes (5 ));
20+ waitingFor (Wait .forListeningPort ())
21+ .withReuse (false );
1722 }
23+
1824 public static synchronized PostgresTC getInstance () {
19- if (INSTANCE == null ) { INSTANCE = new PostgresTC (); INSTANCE .start (); }
25+ if (INSTANCE == null ) {
26+ INSTANCE = new PostgresTC ();
27+ INSTANCE .start ();
28+ }
2029 return INSTANCE ;
2130 }
2231}
You can’t perform that action at this time.
0 commit comments