Skip to content

Commit

Permalink
Merge branch 'master' into corymhall/integ-runner/diff-stacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 27, 2022
2 parents b0c75fe + 91f9aff commit 16aae3e
Show file tree
Hide file tree
Showing 51 changed files with 341 additions and 249 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,26 @@ updates:
labels:
- "auto-approve"
open-pull-requests-limit: 5

# Non-TypeScript init template dependency updates
- package-ecosystem: "pip"
directory: "/packages/aws-cdk/lib/init-templates"
schedule:
interval: "weekly"
labels:
- "auto-approve"
open-pull-requests-limit: 5
- package-ecosystem: "maven"
directory: "/packages/aws-cdk/lib/init-templates"
schedule:
interval: "weekly"
labels:
- "auto-approve"
open-pull-requests-limit: 5
- package-ecosystem: "nuget"
directory: "/packages/aws-cdk/lib/init-templates"
schedule:
interval: "weekly"
labels:
- "auto-approve"
open-pull-requests-limit: 5
4 changes: 4 additions & 0 deletions .github/workflows/yarn-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
lerna exec --parallel ncu -- --upgrade --filter=@types/node,@types/fs-extra --target=minor
lerna exec --parallel ncu -- --upgrade --filter=typescript --target=patch
lerna exec --parallel ncu -- --upgrade --reject='@types/node,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}' --target=minor
# Upgrade package.jsons in init templates
for pj in $(find packages/aws-cdk/lib/init-templates -name package.json); do
(cd $(dirname $pj) && ncu --upgrade --reject='@types/node,@types/fs-extra,constructs,typescript,aws-sdk,aws-sdk-mock,${{ steps.list-packages.outputs.list }}')
done
# This will ensure the current lockfile is up-to-date with the dependency specifications (necessary for "yarn update" to run)
- name: Run "yarn install"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assertions/lib/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class ObjectMatch extends Matcher {
result.recordFailure({
matcher: this,
path: [`/${patternKey}`],
message: 'Missing key',
message: `Missing key '${patternKey}' among {${Object.keys(actual).join(',')}}`,
});
continue;
}
Expand Down
16 changes: 8 additions & 8 deletions packages/@aws-cdk/assertions/test/match.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('Matchers', () => {
'Expected fred but received flob at [1]/waldo',
'Expected flob but received fred at [1]/wobble',
]);
expectFailure(matcher, [{ foo: 'bar', baz: 'qux' }, { waldo: 'fred' }], [/Missing key at \[1\]\/wobble/]);
expectFailure(matcher, [{ foo: 'bar', baz: 'qux' }, { waldo: 'fred' }], [/Missing key.*at \[1\]\/wobble/]);
});

test('objects', () => {
Expand All @@ -49,7 +49,7 @@ describe('Matchers', () => {
expectFailure(matcher, ['3', 5], [/Expected type object but received array/]);
expectFailure(matcher, { baz: 'qux' }, [
'Unexpected key at /baz',
'Missing key at /foo',
/Missing key.*at \/foo/,
]);

matcher = Match.exact({ foo: 'bar', baz: 5 });
Expand All @@ -59,8 +59,8 @@ describe('Matchers', () => {
matcher = Match.exact({ foo: [2, 3], bar: 'baz' });
expectPass(matcher, { foo: [2, 3], bar: 'baz' });
expectFailure(matcher, {}, [
'Missing key at /foo',
'Missing key at /bar',
/Missing key.*at \/foo/,
/Missing key.*at \/bar/,
]);
expectFailure(matcher, { bar: [2, 3], foo: 'baz' }, [
'Expected type array but received string at /foo',
Expand Down Expand Up @@ -155,7 +155,7 @@ describe('Matchers', () => {
expectPass(matcher, { foo: 'bar' });
expectFailure(matcher, { foo: 'baz' }, [/Expected bar but received baz at \/foo/]);
expectFailure(matcher, { foo: ['bar'] }, [/Expected type string but received array at \/foo/]);
expectFailure(matcher, { bar: 'foo' }, [/Missing key at \/foo/]);
expectFailure(matcher, { bar: 'foo' }, [/Missing key.*at \/foo/]);
expectPass(matcher, { foo: 'bar', baz: 'qux' });
});

Expand Down Expand Up @@ -338,7 +338,7 @@ describe('Matchers', () => {
expectPass(matcher, { foo: [1, 2] });

expectFailure(matcher, { foo: null }, ['Expected a value but found none at /foo']);
expectFailure(matcher, {}, ['Missing key at /foo']);
expectFailure(matcher, {}, [/Missing key.*at \/foo/]);
});
});

Expand All @@ -358,7 +358,7 @@ describe('Matchers', () => {
expectFailure(matcher, '{ "Foo": 4 }', ['Expected type string but received number at (serializedJson)/Foo']);
expectFailure(matcher, '{ "Bar": "Baz" }', [
'Unexpected key at (serializedJson)/Bar',
'Missing key at (serializedJson)/Foo',
/Missing key.*at \(serializedJson\)\/Foo/,
]);
});

Expand All @@ -372,7 +372,7 @@ describe('Matchers', () => {
expectPass(matcher, '{ "Foo": ["Bar", "Baz"], "Fred": "Waldo" }');

expectFailure(matcher, '{ "Foo": ["Baz"] }', ['Missing element [Bar] at pattern index 0 at (serializedJson)/Foo']);
expectFailure(matcher, '{ "Bar": ["Baz"] }', ['Missing key at (serializedJson)/Foo']);
expectFailure(matcher, '{ "Bar": ["Baz"] }', [/Missing key.*at \(serializedJson\)\/Foo/]);
});

test('invalid json string', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/assertions/test/template.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('Template', () => {

expect(() => inspect.hasResource('Foo::Bar', {
Properties: { baz: 'qux', fred: 'waldo' },
})).toThrow(/Missing key at \/Properties\/fred/);
})).toThrow(/Missing key.*at \/Properties\/fred/);
});

test('arrayWith', () => {
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('Template', () => {
.toThrow(/Expected waldo but received qux at \/Properties\/baz/);

expect(() => inspect.hasResourceProperties('Foo::Bar', { baz: 'qux', fred: 'waldo' }))
.toThrow(/Missing key at \/Properties\/fred/);
.toThrow(/Missing key.*at \/Properties\/fred/);
});

test('absent - with properties', () => {
Expand Down Expand Up @@ -367,7 +367,7 @@ describe('Template', () => {
const inspect = Template.fromStack(stack);

expect(() => inspect.hasResourceProperties('Foo::Bar', { bar: Match.absent(), baz: 'qux' }))
.toThrow(/Missing key at \/Properties\/baz/);
.toThrow(/Missing key.*at \/Properties\/baz/);

inspect.hasResourceProperties('Foo::Bar', Match.absent());
});
Expand Down
Loading

0 comments on commit 16aae3e

Please sign in to comment.