File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed
src/test/java/com/google/cloud/spanner/jdbc/it Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,16 @@ if [[ ! -z "${GOOGLE_APPLICATION_CREDENTIALS}" && "${GOOGLE_APPLICATION_CREDENTI
4242 export GOOGLE_APPLICATION_CREDENTIALS=$( realpath ${KOKORO_GFILE_DIR} /${GOOGLE_APPLICATION_CREDENTIALS} )
4343fi
4444
45+ # Start the Spanner emulator if the environment variable for it has been set.
46+ # TODO: Change if statement once the env var can be set in the config.
47+ # if [[ ! -z "${SPANNER_EMULATOR_HOST}" ]]; then
48+ if [[ " $JOB_TYPE " == " graalvm" ]] || [[ " $JOB_TYPE " == " graalvm17" ]]; then
49+ echo " Starting emulator"
50+ export SPANNER_EMULATOR_HOST=localhost:9010
51+ docker pull gcr.io/cloud-spanner-emulator/emulator
52+ docker run -d --rm --name spanner-emulator -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
53+ fi
54+
4555RETURN_CODE=0
4656set +e
4757
@@ -145,6 +155,11 @@ clirr)
145155 ;;
146156esac
147157
158+ if [[ ! -z " ${SPANNER_EMULATOR_HOST} " ]]; then
159+ echo " Stopping emulator"
160+ docker container stop spanner-emulator
161+ fi
162+
148163if [ " ${REPORT_COVERAGE} " == " true" ]
149164then
150165 bash ${KOKORO_GFILE_DIR} /codecov.sh
Original file line number Diff line number Diff line change 2525import com .google .cloud .spanner .DatabaseAdminClient ;
2626import com .google .cloud .spanner .DatabaseId ;
2727import com .google .cloud .spanner .Dialect ;
28- import com .google .cloud .spanner .IntegrationTestEnv ;
2928import com .google .cloud .spanner .ParallelIntegrationTest ;
3029import com .google .cloud .spanner .Value ;
3130import com .google .cloud .spanner .connection .ConnectionOptions ;
5453@ RunWith (JUnit4 .class )
5554public class ITJdbcPgNumericTest {
5655
57- @ ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv ();
56+ @ ClassRule public static JdbcIntegrationTestEnv env = new JdbcIntegrationTestEnv ();
5857
5958 private static final Duration OPERATION_TIMEOUT = Duration .ofMinutes (10 );
6059 private static RemoteSpannerHelper testHelper ;
Original file line number Diff line number Diff line change 2828import com .google .cloud .spanner .DatabaseAdminClient ;
2929import com .google .cloud .spanner .DatabaseId ;
3030import com .google .cloud .spanner .Dialect ;
31- import com .google .cloud .spanner .IntegrationTestEnv ;
3231import com .google .cloud .spanner .ParallelIntegrationTest ;
3332import com .google .cloud .spanner .connection .ConnectionOptions ;
3433import com .google .cloud .spanner .jdbc .ProtoEnumType ;
5756@ Category (ParallelIntegrationTest .class )
5857@ RunWith (JUnit4 .class )
5958public class ITProtoColumnsTest {
60- @ ClassRule public static IntegrationTestEnv env = new IntegrationTestEnv ();
59+ @ ClassRule public static JdbcIntegrationTestEnv env = new JdbcIntegrationTestEnv ();
6160 private static final Duration OPERATION_TIMEOUT = Duration .ofMinutes (10 );
6261 private static Database database ;
6362 private static String url ;
You can’t perform that action at this time.
0 commit comments