This module includes both unit tests, which can run in isolation without connecting to the GCS service, and integration tests, which require a working connection to GCS to interact with a bucket. Unit test suites follow the naming convention Test*.java. Integration tests follow the naming convention ITest*.java.
To integration test the GCS filesystem client, you need to provide auth-keys.xml which passes in authentication details to the test runner.
It is a Hadoop XML configuration file, which must be placed into hadoop-tools/hadoop-gcp/src/test/resources.
core-site.xmlThis file pre-exists and sources the configurations created under auth-keys.xml.
For most purposes you will not need to edit this file unless you need to apply a specific, non-default property change during the tests.
auth-keys.xmlThe presence of this file triggers the testing of the GCS classes.
Without this file, none of the integration tests in this module will be executed.
fs.contract.test.fs.gs : the URL of the bucket for GCS filesystem contract testsExample:
<configuration>
<property>
<name>fs.gs.auth.type</name>
<value>SERVICE_ACCOUNT_JSON_KEYFILE</value>
</property>
<property>
<name>fs.gs.auth.service.account.json.keyfile</name>
<value>YOUR_JSON_KEY_FILE</value>
</property>
<property>
<name>fs.gs.project.id</name>
<value>YOUR_PROJECT_ID_HERE</value>
</property>
<property>
<name>fs.contract.test.fs.gs</name>
<value>gs://your_bucket</value>
</property>
</configuration>
After completing the configuration, execute the test run through Maven.
mvn clean verify