Skip to content

Making tests opt-out instead of opt-in and update TestVectorRunner #154

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

Merged
merged 3 commits into from
Feb 7, 2020

Conversation

WesleyRosenblum
Copy link
Contributor

Description of changes:

JUnit5 doesn't support test suites yet (see junit-team/junit5#744) and the existing
test suites do not support the new JUnit5 tests that are being used for keyrings. This change removes the test
suites, and configures Maven to include all tests except those marked with certain JUnit tags.

Additionally, this change updates the TestVectorRunner to also test Keyrings and removes the redundant XCompat tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@mattsb42-aws mattsb42-aws mentioned this pull request Feb 5, 2020
15 tasks
@WesleyRosenblum WesleyRosenblum force-pushed the keyringtests branch 2 times, most recently from 43e0bf8 to c973367 Compare February 6, 2020 19:32
pom.xml Outdated
<includes>
<include>**/AllTestsSuite.java</include>
</includes>
<excludedGroups>slow</excludedGroups>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"full" would seem to indicate that we're running everything. If we're not running slow tests in "full", where are we running them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only test marked as slow is FrameEncryptionHandlerVeryLongTest, which takes 3 hours to run. I'm not sure under what circumstances we would want to run it, but you can always manually run it. Would it be better if I renamed this tag to something like manualInvocationOnly?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we stuck with the name "full-test-suite"? Why not just "test-suite"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed it to test-suite. I've also renamed the tag to be "ad_hoc", as I felt it was a little confusing having a "slow" tag and also a fastTestsOnly system property.

JUnit5 doesn't support test suites yet
(see junit-team/junit5#744) and the existing
test suites do not support the new JUnit5 tests that are being used for
keyrings. This change removes the test suites, and configures Maven to
include all tests except those marked with certain JUnit tags.

Additionally, this change updates the TestVectorRunner to also test
Keyrings and removes the redundant XCompat tests.
pom.xml Outdated
<includes>
<include>**/AllTestsSuite.java</include>
</includes>
<excludedGroups>slow</excludedGroups>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we stuck with the name "full-test-suite"? Why not just "test-suite"?

Comment on lines 147 to 148
cachedData.putIfAbsent(plaintextUrl, readBytesFromJar(jar, plaintextUrl));
cachedData.putIfAbsent(ciphertextURL, readBytesFromJar(jar, ciphertextURL));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This always reads the data from the JAR rather than only reading it if there is a cache miss. That might be expensive as I'm not sure how the data is being cached locally by Java. You could use computeIfAbsent if you want though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor

@SalusaSecondus SalusaSecondus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@WesleyRosenblum WesleyRosenblum merged commit cffe776 into materialsmanager Feb 7, 2020
@WesleyRosenblum WesleyRosenblum deleted the keyringtests branch February 7, 2020 23:29
WesleyRosenblum added a commit that referenced this pull request Feb 12, 2020
…#151)

* Incorporate Keyrings into AwsCrypto and deprecate MasterKeyProviders.

* Update example code to use keyrings

* Using try-with-resources for AwsCrypto streams

* Splitting MKP and keyring unit tests

* Making decryptData with ParsedCiphertext public

* Mark KeyStoreProvider as deprecated

* Reword some comments on the Basic Encryption example

* Add test for compability of Keyrings with MasterKeyProviders

* Create individual request types for each AwsCrypto method

* Make EncryptionMaterials, DecryptionMaterials and KeyringTrace immutable

* Rename KmsKeying and related classes to AwsKmsKeyring

* Create builders for the standard keyrings

* Create AwsKmsCmkId type to represent AWS KMS Key Ids

* Add factory methods to Keyring builders

* Add comment on not making a defensive copy of plaintext/ciphertext

* Limit ability to create discovery AWS KMS Keyrings to explicit creation

* Add withKeyring to CachingCMM builder

* Fix DecryptRequestTest

* Fix Junit 4 assertions in JUnit5 tests

* Renaming StaticKeyring to TestKeyring

* Adding convenience methods the create builders internally

* Updating wording and adding more Deprecated annotations

* Enable AwsKms Client Caching by default to match KmsMasterKeyProvider

* Making tests opt-out instead of opt-in and update TestVectorRunner (#154)

* Making tests opt-out instead of opt-in and update TestVectorRunner

JUnit5 doesn't support test suites yet
(see junit-team/junit5#744) and the existing
test suites do not support the new JUnit5 tests that are being used for
keyrings. This change removes the test suites, and configures Maven to
include all tests except those marked with certain JUnit tags.

Additionally, this change updates the TestVectorRunner to also test
Keyrings and removes the redundant XCompat tests.

* Client caching is now enabled by default in AwsKmsClientSupplier

* Rename slow tag to ad_hoc and fix TestVectorRunner

* Renaming StandardKeyring builder methods and other minors changes

* Fixing test

* Updating tests to use assertThrows

* Additional example code for Keyrings (#155)

* Additional example code for Keyrings

* Updating wording

* Remove AWS from AWS KMS keyring and make keyring lowercase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants