Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…docs-samples into fix/github-actions-token-failure
  • Loading branch information
kweinmeister committed Jun 15, 2023
2 parents 17b190f + c456528 commit f4f006f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion iam/package.json → iam/deny/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"node": ">=12.0.0"
},
"scripts": {
"test": "c8 mocha test/*.test.js --timeout=5000"
"test": "c8 mocha test/*.test.js --timeout=60000"
},
"dependencies": {
"@google-cloud/iam": "^0.3.0"
Expand Down
16 changes: 6 additions & 10 deletions iam/test/deny.test.js → iam/deny/test/deny.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const iamClient = new PoliciesClient();

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});

describe.skip('IAM deny samples', () => {
describe('IAM deny samples', () => {
let projectId;
const policyId = `gcloud-test-policy-${uuid.v4().split('-')[0]}`;
const policyName = `policies/cloudresourcemanager.googleapis.com%2Fprojects%2F949737848314/denypolicies/${policyId}`;
Expand All @@ -33,21 +33,19 @@ describe.skip('IAM deny samples', () => {
});

it('should create IAM policy', async () => {
const output = execSync(
`node deny/createDenyPolicy ${projectId} ${policyId}`
);
const output = execSync(`node createDenyPolicy ${projectId} ${policyId}`);

assert.include(output, `Created the deny policy: ${policyName}`);
});

it('should list IAM policies', async () => {
const output = execSync(`node deny/listDenyPolicies ${projectId}`);
const output = execSync(`node listDenyPolicies ${projectId}`);

assert.include(output, `- ${policyName}`);
});

it('should get IAM policies', async () => {
const output = execSync(`node deny/getDenyPolicy ${projectId} ${policyId}`);
const output = execSync(`node getDenyPolicy ${projectId} ${policyId}`);

assert.include(output, `Retrieved the deny policy: ${policyName}`);
});
Expand All @@ -57,16 +55,14 @@ describe.skip('IAM deny samples', () => {
name: policyName,
});
const output = execSync(
`node deny/updateDenyPolicy ${projectId} ${policyId} ${policy.etag}`
`node updateDenyPolicy ${projectId} ${policyId} ${policy.etag}`
);

assert.include(output, `Updated the deny policy: ${policyName}`);
});

it('should delete IAM policy', async () => {
const output = execSync(
`node deny/deleteDenyPolicy ${projectId} ${policyId}`
);
const output = execSync(`node deleteDenyPolicy ${projectId} ${policyId}`);

assert.include(output, `Deleted the deny policy: ${policyName}`);
});
Expand Down

0 comments on commit f4f006f

Please sign in to comment.