Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tests): use unique prefix for system tests to avoid collision with another run #468

Merged
merged 2 commits into from Oct 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions system-test/storage.ts
Expand Up @@ -45,7 +45,7 @@ const PubSub = require('@google-cloud/pubsub');

describe('storage', () => {
const USER_ACCOUNT = 'user-spsawchuk@gmail.com';
const TESTS_PREFIX = 'gcloud-storage-tests-';
const TESTS_PREFIX = `storage-tests-${shortUUID()}-`;

const storage = new Storage({});
const bucket = storage.bucket(generateName());
Expand Down Expand Up @@ -2801,8 +2801,12 @@ describe('storage', () => {
topic.delete(callback);
}

function shortUUID() {
return uuid.v1().split('-').shift();
}

function generateName() {
return TESTS_PREFIX + uuid.v1();
return TESTS_PREFIX + shortUUID();
}

function deleteAllBuckets(callback) {
Expand Down