This is an automated email from the ASF dual-hosted git repository. cnauroth pushed a commit to branch HADOOP-19343 in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/HADOOP-19343 by this push: new 0b4e83312b9 HADOOP-19343: Add instruction for running tests 0b4e83312b9 is described below commit 0b4e83312b930b1d12d921fcd77ebac4e341a277 Author: Arunkumar Chacko <aruncha...@google.com> AuthorDate: Mon Jun 16 19:48:13 2025 +0000 HADOOP-19343: Add instruction for running tests Closes #7734 Signed-off-by: Chris Nauroth <cnaur...@apache.org> --- .../src/site/markdown/tools/hadoop-gcp/testing.md | 70 ++++++++++++++++++++++ .../hadoop/fs/gs/contract/GoogleContract.java | 7 --- .../hadoop-gcp/src/test/resources/contract/gs.xml | 21 +++++++ 3 files changed, 91 insertions(+), 7 deletions(-) diff --git a/hadoop-tools/hadoop-gcp/src/site/markdown/tools/hadoop-gcp/testing.md b/hadoop-tools/hadoop-gcp/src/site/markdown/tools/hadoop-gcp/testing.md new file mode 100644 index 00000000000..a56d7e6c395 --- /dev/null +++ b/hadoop-tools/hadoop-gcp/src/site/markdown/tools/hadoop-gcp/testing.md @@ -0,0 +1,70 @@ +<!--- + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. See accompanying LICENSE file. +--> + +# Testing the GCS filesystem client and its features + +<!-- MACRO{toc|fromDepth=0|toDepth=3} --> + +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`. + +## <a name="setting-up"></a> Setting up the tests + +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`. + +### File `core-site.xml` + +This 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. + +### File `auth-keys.xml` + +The 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 tests + +Example: + +```xml +<configuration> + <property> + <name>fs.contract.test.fs.gs</name> + <value>gs://your bucket name</value> + </property> + +</configuration> +``` + +## <a name="running"></a> Running the Tests + +After completing the configuration, execute the test run through Maven. + +This has to be run from a GCP VM. This limitation will be removed later. + +```bash +mvn clean verify +``` \ No newline at end of file diff --git a/hadoop-tools/hadoop-gcp/src/test/java/org/apache/hadoop/fs/gs/contract/GoogleContract.java b/hadoop-tools/hadoop-gcp/src/test/java/org/apache/hadoop/fs/gs/contract/GoogleContract.java index aa131981caf..af65e2c516b 100644 --- a/hadoop-tools/hadoop-gcp/src/test/java/org/apache/hadoop/fs/gs/contract/GoogleContract.java +++ b/hadoop-tools/hadoop-gcp/src/test/java/org/apache/hadoop/fs/gs/contract/GoogleContract.java @@ -18,7 +18,6 @@ package org.apache.hadoop.fs.gs.contract; -import org.apache.hadoop.fs.gs.TestConfiguration; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.contract.AbstractBondedFSContract; @@ -29,12 +28,6 @@ public class GoogleContract extends AbstractBondedFSContract { public GoogleContract(Configuration conf) { super(conf); addConfResource(CONTRACT_XML); - conf.set("fs.contract.test.fs.gs", "gs://arunchacko-oss-test-bucket"); // TODO: - - TestConfiguration testConf = TestConfiguration.getInstance(); - if (testConf.getProjectId() != null) { - conf.set("fs.gs.project.id", testConf.getProjectId()); - } } @Override diff --git a/hadoop-tools/hadoop-gcp/src/test/resources/contract/gs.xml b/hadoop-tools/hadoop-gcp/src/test/resources/contract/gs.xml new file mode 100644 index 00000000000..1de34245a5d --- /dev/null +++ b/hadoop-tools/hadoop-gcp/src/test/resources/contract/gs.xml @@ -0,0 +1,21 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<configuration> + +</configuration> --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org