Skip to content

Commit

Permalink
fix codepipelines test
Browse files Browse the repository at this point in the history
  • Loading branch information
Elad Ben-Israel committed Apr 6, 2020
1 parent e241660 commit 9957251
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codepipeline/test/test.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export = {
},

'automatically assigns artifact names to the Actions'(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
const pipeline = new codepipeline.Pipeline(stack, 'pipeline');

const sourceOutput = new codepipeline.Artifact();
Expand Down
16 changes: 10 additions & 6 deletions packages/@aws-cdk/aws-codepipeline/test/test.artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export = {
},

'without a name, when used as an input without being used as an output first - should fail validation'(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
const sourceOutput = new codepipeline.Artifact();
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
stages: [
Expand Down Expand Up @@ -88,7 +89,8 @@ export = {
},

'without a name, when used as an output multiple times - should fail validation'(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
const sourceOutput = new codepipeline.Artifact();
const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
stages: [
Expand Down Expand Up @@ -125,7 +127,8 @@ export = {
},

"an Action's output can be used as input for an Action in the same Stage with a higher runOrder"(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');

const sourceOutput1 = new codepipeline.Artifact('sourceOutput1');
const buildOutput1 = new codepipeline.Artifact('buildOutput1');
Expand Down Expand Up @@ -174,7 +177,8 @@ export = {
},

'without a name, sanitize the auto stage-action derived name'(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');

const sourceOutput = new codepipeline.Artifact();
new codepipeline.Pipeline(stack, 'Pipeline', {
Expand Down Expand Up @@ -233,6 +237,6 @@ export = {
};

function validate(construct: cdk.IConstruct): cdk.ValidationError[] {
cdk.ConstructNode.prepare(construct.node);
return cdk.ConstructNode.validate(construct.node);
cdk.ConstructNode.prepare(construct.node.root.node);
return cdk.ConstructNode.validate(construct.node.root.node);
}
4 changes: 3 additions & 1 deletion packages/@aws-cdk/aws-codepipeline/test/test.pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,9 @@ export = {
const replicationRegion = 'us-west-1';

const pipelineRegion = 'us-west-2';
const pipelineStack = new cdk.Stack(undefined, undefined, {

const app = new cdk.App();
const pipelineStack = new cdk.Stack(app, 'stack', {
env: { region: pipelineRegion },
});
const sourceOutput = new codepipeline.Artifact();
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-codepipeline/test/test.variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ export = {
},

'allows using the variable in the configuration of a different action'(test: Test) {
const stack = new cdk.Stack();
const app = new cdk.App();
const stack = new cdk.Stack(app, 'stack');
const sourceOutput = new codepipeline.Artifact();
const fakeSourceAction = new FakeSourceAction({
actionName: 'Source',
Expand Down

0 comments on commit 9957251

Please sign in to comment.