-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): use unique prefix for system tests to avoid collision wit…
…h another run (#468)
- Loading branch information
1 parent
f43bd18
commit 5951a63
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ const PubSub = require('@google-cloud/pubsub'); | |
|
||
describe('storage', () => { | ||
const USER_ACCOUNT = '[email protected]'; | ||
const TESTS_PREFIX = 'gcloud-storage-tests-'; | ||
const TESTS_PREFIX = `storage-tests-${shortUUID()}-`; | ||
|
||
const storage = new Storage({}); | ||
const bucket = storage.bucket(generateName()); | ||
|
@@ -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) { | ||
|