Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/api_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const {
TIMEOUT,
TAGS,
PUBLIC_IDS,
UNIQUE_JOB_ID,
UNIQUE_JOB_SUFFIX_ID,
PRESETS,
TRANSFORMATIONS,
PUBLIC_ID_PREFIX
Expand Down Expand Up @@ -142,7 +142,7 @@ function findByAttr(elements, attr, value) {


describe("api", function () {
var contextKey = `test-key${UNIQUE_JOB_ID}`;
var contextKey = `test-key${UNIQUE_JOB_SUFFIX_ID}`;
before("Verify Configuration", function () {
let config = cloudinary.config(true);
if (!(config.api_key && config.api_secret)) {
Expand Down Expand Up @@ -503,7 +503,7 @@ describe("api", function () {
var transformationName;
itBehavesLike("a list with a cursor", cloudinary.v2.api.transformation, EXPLICIT_TRANSFORMATION_NAME);
itBehavesLike("a list with a cursor", cloudinary.v2.api.transformations);
transformationName = "api_test_transformation3" + UNIQUE_JOB_ID;
transformationName = "api_test_transformation3" + UNIQUE_JOB_SUFFIX_ID;
after(function () {
return Q.allSettled(
[
Expand Down Expand Up @@ -949,7 +949,7 @@ describe("api", function () {
describe('.restore', function () {
this.timeout(TIMEOUT.MEDIUM);

const publicId = "api_test_restore" + UNIQUE_JOB_ID;
const publicId = "api_test_restore" + UNIQUE_JOB_SUFFIX_ID;
before(() => uploadImage({
public_id: publicId,
backup: true,
Expand Down
4 changes: 2 additions & 2 deletions test/search_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const {
TIMEOUT,
TAGS,
PUBLIC_IDS,
UNIQUE_JOB_ID,
UNIQUE_JOB_SUFFIX_ID,
} = testConstants;

const {
Expand All @@ -28,7 +28,7 @@ const {
UPLOAD_TAGS,
} = TAGS;

const SEARCH_TAG = 'npm_advanced_search_' + UNIQUE_JOB_ID;
const SEARCH_TAG = 'npm_advanced_search_' + UNIQUE_JOB_SUFFIX_ID;


describe("search_api", function () {
Expand Down
20 changes: 10 additions & 10 deletions test/testUtils/testConstants.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
const UNIQUE_JOB_ID = process.env.TRAVIS_JOB_ID || Math.floor(Math.random() * 999999);
const UNIQUE_JOB_SUFFIX_ID = process.env.TRAVIS_JOB_ID || Math.floor(Math.random() * 999999);

// create public ID string for tests
const PUBLIC_ID_PREFIX = "npm_api_test";
const PUBLIC_ID = PUBLIC_ID_PREFIX + UNIQUE_JOB_ID;
const PUBLIC_ID = PUBLIC_ID_PREFIX + UNIQUE_JOB_SUFFIX_ID;

// create test tag string for tests
const SDK_TAG = "SDK_TEST"; // identifies resources created by all SDKs tests
const TEST_TAG_PREFIX = "cloudinary_npm_test"; // identifies resources created by this SDKs tests
const TEST_TAG = `${TEST_TAG_PREFIX}_${UNIQUE_JOB_ID}`;
const TEST_TAG = `${TEST_TAG_PREFIX}_${UNIQUE_JOB_SUFFIX_ID}`;
const UPLOAD_TAGS = [TEST_TAG, TEST_TAG_PREFIX, SDK_TAG];

module.exports = {
Expand All @@ -19,7 +19,7 @@ module.exports = {
LONG: 50000,
LARGE: 70000,
},
UNIQUE_JOB_ID,
UNIQUE_JOB_SUFFIX_ID,
PUBLIC_IDS: {
PUBLIC_ID,
PUBLIC_ID_1: `${PUBLIC_ID}_1`,
Expand All @@ -30,14 +30,14 @@ module.exports = {
PUBLIC_ID_6: `${PUBLIC_ID}_6`,
},
PRESETS: {
API_TEST_UPLOAD_PRESET1: `npm_api_test_upload_preset_1_${UNIQUE_JOB_ID}`,
API_TEST_UPLOAD_PRESET2: `npm_api_test_upload_preset_2_${UNIQUE_JOB_ID}`,
API_TEST_UPLOAD_PRESET3: `npm_api_test_upload_preset_3_${UNIQUE_JOB_ID}`,
API_TEST_UPLOAD_PRESET4: `npm_api_test_upload_preset_4_${UNIQUE_JOB_ID}`,
API_TEST_UPLOAD_PRESET1: `npm_api_test_upload_preset_1_${UNIQUE_JOB_SUFFIX_ID}`,
API_TEST_UPLOAD_PRESET2: `npm_api_test_upload_preset_2_${UNIQUE_JOB_SUFFIX_ID}`,
API_TEST_UPLOAD_PRESET3: `npm_api_test_upload_preset_3_${UNIQUE_JOB_SUFFIX_ID}`,
API_TEST_UPLOAD_PRESET4: `npm_api_test_upload_preset_4_${UNIQUE_JOB_SUFFIX_ID}`,
},
TRANSFORMATIONS: {
NAMED_TRANSFORMATION: `npm_api_test_transformation_${UNIQUE_JOB_ID}`,
NAMED_TRANSFORMATION2: `npm_api_test_transformation_2_${UNIQUE_JOB_ID}`,
NAMED_TRANSFORMATION: `npm_api_test_transformation_${UNIQUE_JOB_SUFFIX_ID}`,
NAMED_TRANSFORMATION2: `npm_api_test_transformation_2_${UNIQUE_JOB_SUFFIX_ID}`,
EXPLICIT_TRANSFORMATION_NAME: `c_scale,l_text:Arial_60:${TEST_TAG},w_100`,
EXPLICIT_TRANSFORMATION_NAME2: `c_scale,l_text:Arial_60:${TEST_TAG},w_200`,
},
Expand Down