Skip to content

Commit

Permalink
fix(tests): use unique prefix for system tests to avoid collision wit…
Browse files Browse the repository at this point in the history
…h another run (#468)
  • Loading branch information
jkwlui authored and JustinBeckwith committed Oct 18, 2018
1 parent f43bd18 commit 5951a63
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 5951a63

Please sign in to comment.