(to run locally your must have the data api running locally on op of HCD or DSE)
mvn clean test -Ptest_local
Why it works ?
- In
pom.xml
the environment variableASTRA_DB_JAVA_TEST_ENV
is set tolocal
- Tests are annotated with
@EnabledIfSystemProperty(named = "ASTRA_DB_JAVA_TEST_ENV", matches = "local") @DisabledIfSystemProperty(named = "ASTRA_DB_JAVA_TEST_ENV", matches = "(?!local)") public class MyTest { }
- To run with IDE make sure to set the environment variable
ASTRA_DB_JAVA_TEST_ENV
tolocal
in your Run configuration
-
ASTRA_DB_APPLICATION_TOKEN_DEV
should be defined in your environment variables, it is not in the different POM for privacy reasons. -
To run with Maven (AWS,
eu-west-2
)
mvn clean test -Ptest_astra_dev
- To run with Maven on One particular region
mvn clean test -Ptest_astra_dev \
-DASTRA_CLOUD_PROVIDER_DEV=GCP \
-DASTRA_CLOUD_REGION_DEV=us-central-1
- To run overriding also the token
mvn clean test \
-Ptest_astra_dev \
-DASTRA_CLOUD_PROVIDER_DEV=GCP \
-DASTRA_CLOUD_REGION_DEV=us-central-1 \
-ASTRA_DB_APPLICATION_TOKEN_DEV=AstraCS:... \
-Dtest="com.datastax.astra.test.integration.*.*Test"