Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Tulsishah committed May 31, 2024
1 parent c5514b5 commit 9330391
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ git checkout $commitId

echo "Running e2e tests on installed package...."
# $1 argument is refering to value of testInstalledPackage
./tools/integration_tests/run_e2e_tests.sh $RUN_E2E_TESTS_ON_INSTALLED_PACKAGE $SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE
./tools/integration_tests/run_e2e_tests.sh $RUN_E2E_TESTS_ON_INSTALLED_PACKAGE $SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE $BUCKET_LOCATION $RUN_TEST_ON_TPC_ENDPOINT
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ readonly SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE=true
readonly RUN_TEST_ON_TPC_ENDPOINT=true
# TPC project id
readonly PROJECT_ID="tpczero-system:gcsfuse-test-project"
readonly BUCKET_LOCATION="u-us-prp1"

cd "${KOKORO_ARTIFACTS_DIR}/github/gcsfuse"
echo "Building and installing gcsfuse..."
Expand All @@ -44,7 +45,7 @@ gcloud config set project $PROJECT_ID

set +e
# $1 argument is refering to value of testInstalledPackage
./tools/integration_tests/run_e2e_tests.sh $RUN_E2E_TESTS_ON_INSTALLED_PACKAGE $SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE $RUN_TEST_ON_TPC_ENDPOINT
./tools/integration_tests/run_e2e_tests.sh $RUN_E2E_TESTS_ON_INSTALLED_PACKAGE $SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE $BUCKET_LOCATION $RUN_TEST_ON_TPC_ENDPOINT
set -e

# Activate default environment after testing.
Expand Down
9 changes: 4 additions & 5 deletions tools/integration_tests/run_e2e_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ RUN_E2E_TESTS_ON_PACKAGE=$1
SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE=$2
# Pass "true" to run e2e tests on TPC endpoint.
# The default value will be false.
BUCKET_LOCATION=$3
RUN_TEST_ON_TPC_ENDPOINT=false
if [ $3 != "" ]; then
RUN_TEST_ON_TPC_ENDPOINT=$3
if [ $4 != "" ]; then
RUN_TEST_ON_TPC_ENDPOINT=$4
fi

INTEGRATION_TEST_TIMEOUT=60m

if [ "$#" -ne 3 ]
if [ "$#" -ne 4 ]
then
echo "Incorrect number of arguments passed, please refer to the script and pass the three arguments required..."
exit 1
Expand All @@ -43,7 +43,6 @@ if [ "$SKIP_NON_ESSENTIAL_TESTS_ON_PACKAGE" == true ]; then
echo "Changing the integration test timeout to: $INTEGRATION_TEST_TIMEOUT"
fi

readonly BUCKET_LOCATION="us-west1"
readonly RANDOM_STRING_LENGTH=5
# Test directory arrays
TEST_DIR_PARALLEL=(
Expand Down
2 changes: 1 addition & 1 deletion tools/integration_tests/util/client/storage_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func CreateStorageClient(ctx context.Context) (client *storage.Client, err error
// Set up the TPC endpoint and provide a token source for authentication.
ts, err = getTokenSrc("/tmp/sa.key.json")
if err != nil {
return nil, fmt.Errorf(fmt.Sprintf("Unable to fetch tokenSrc for TPC: %v", err))
return nil, fmt.Errorf("unable to fetch token-source for TPC: %w", err)
}
client, err = storage.NewClient(ctx, option.WithEndpoint("storage.apis-tpczero.goog:443"), option.WithTokenSource(ts))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,17 @@ func CreateTestBucketForDynamicMounting() (bucketName string) {
var err error

if setup.TestOnTPCEndPoint() {
// Set TPC project and location create bucket.
project_id = "tpczero-system:gcsfuse-test-project"
location = "u-us-prp1"
} else {
project_id, err = metadata.ProjectID()
if err != nil {
log.Printf("Error in fetching project id: %v", err)
}
location = "us-west1"
// We are creating a bucket in the us-central1 location because our continuous
// end-to-end tests are running from a VM in the us-central1 region.
location = "us-central1"
}

// Create bucket with name gcsfuse-dynamic-mounting-test-xxxxx
Expand Down

0 comments on commit 9330391

Please sign in to comment.