Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert: Incorrect matches with MatchStyle.SUPERSET #3399

Closed
1 of 5 tasks
nmussy opened this issue Jul 23, 2019 · 0 comments · Fixed by #3408
Closed
1 of 5 tasks

Assert: Incorrect matches with MatchStyle.SUPERSET #3399

nmussy opened this issue Jul 23, 2019 · 0 comments · Fixed by #3408
Labels
needs-triage This issue or PR still needs to be triaged.

Comments

@nmussy
Copy link
Contributor

nmussy commented Jul 23, 2019

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository's issues are intended for feature requests and bug reports.

  • I'm submitting a ...

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior?
    If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce
    Given the following test:

    test.deepEqual(template.Parameters, {
    "SsmParameterValueawsserviceecsoptimizedamiwindowsserver2019englishfullrecommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": {
    "Type": "AWS::SSM::Parameter::Value<String>",
    "Default": "/aws/service/ecs/optimized-ami/windows_server/2019/english/full/recommended/image_id"
    }
    });

Both of these tests also pass:

// should match, does match
expect(stack).toMatch({
  "Parameters": {
    "SsmParameterValueawsserviceecsoptimizedamiwindowsserver2019englishfullrecommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": {
      "Type": "AWS::SSM::Parameter::Value<String>",
      "Default": "/aws/service/ecs/optimized-ami/windows_server/2019/english/full/recommended/image_id"
    }
  }
}, MatchStyle.SUPERSET);

// shouldn't match, does match
expect(stack).toMatch({
  "Parameters": {
    "SsmParameterValueawsserviceecsoptimizedamiwindowsserver2019englishfullrecommendedimageidC96584B6F00A464EAD1953AFF4B05118Parameter": {
      "Type": "AWS::SSM::Parameter::Value<String>",
      "Default": "incorrect"
    }
  }
}, MatchStyle.SUPERSET);
  • What is the expected behavior (or behavior of feature suggested)?
    The second added assertions should fail

  • What is the motivation / use case for changing the behavior or adding this feature?
    Contributor and maintainer QoL, doesn't require synthesizing an app

  • Please tell us about your environment:

    • CDK CLI Version: 1.1.0
    • Module Version: 1.1.0
    • OS: all
    • Language: all
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)
    I haven't really looked into it yet, but any insight would be appreciated.

@nmussy nmussy added the needs-triage This issue or PR still needs to be triaged. label Jul 23, 2019
eladb pushed a commit that referenced this issue Jul 24, 2019
* `NO_REPLACES` now verifies that no parameters are updated
* `SUPERSET` now verifies that no parameters are added

Fixes #3399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant