Skip to content
25 changes: 20 additions & 5 deletions dataproc/system-test/createCluster.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,26 @@ const execSync = cmd =>
});

describe('create a dataproc cluster', () => {
it('should create a dataproc cluster', async () => {
const stdout = execSync(
`node createCluster.js "${projectId}" "${region}" "${clusterName}"`
);
assert.match(stdout, new RegExp(`${clusterName}`));
it('should create a dataproc cluster', async function () {
try {
const stdout = execSync(
`node createCluster.js "${projectId}" "${region}" "${clusterName}"`
);
assert.match(stdout, new RegExp(`${clusterName}`));
} catch (err) {
if (
err?.message?.includes('QUOTA') ||
err?.message?.includes('RESOURCE_EXHAUSTED') ||
err?.message?.includes('DISKS_TOTAL_GB')
) {
console.warn(
`Quota limit reached in project ${projectId}. Skipping test.`
);
this.skip();
Comment thread
angelcaamal marked this conversation as resolved.
} else {
throw err;
}
}
});

after(async () => {
Expand Down
27 changes: 21 additions & 6 deletions dataproc/system-test/instantiateInlineWorkflowTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,26 @@ const {delay} = require('./util');

describe('instantiate an inline workflow template', () => {
it('should instantiate an inline workflow template', async function () {
this.retries(4);
await delay(this.test);
const stdout = execSync(
`node instantiateInlineWorkflowTemplate.js "${projectId}" "${region}"`
);
assert.match(stdout, /successfully/);
try {
this.retries(4);
await delay(this.test);
const stdout = execSync(
`node instantiateInlineWorkflowTemplate.js "${projectId}" "${region}"`
);
assert.match(stdout, /successfully/);
} catch (err) {
if (
err?.message?.includes('QUOTA') ||
err?.message?.includes('RESOURCE_EXHAUSTED') ||
err?.message?.includes('DISKS_TOTAL_GB')
) {
console.warn(
`Quota limit reached in project ${projectId}. Skipping test.`
);
this.skip();
} else {
throw err;
}
}
});
});
21 changes: 18 additions & 3 deletions dataproc/system-test/submitJob.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,24 @@ const execSync = cmd =>
});

describe('submit a Spark job to a Dataproc cluster', () => {
before(async () => {
const [operation] = await clusterClient.createCluster(cluster);
await operation.promise();
before(async function () {
try {
const [operation] = await clusterClient.createCluster(cluster);
await operation.promise();
} catch (err) {
if (
err?.message?.includes('QUOTA') ||
err?.message?.includes('RESOURCE_EXHAUSTED') ||
err?.message?.includes('DISKS_TOTAL_GB')
) {
console.warn(
`Quota limit reached in project ${projectId}. Skipping test.`
);
this.skip();
Comment thread
angelcaamal marked this conversation as resolved.
} else {
throw err;
}
}
});

it('should submit a job to a dataproc cluster', async () => {
Expand Down
Loading