-
Notifications
You must be signed in to change notification settings - Fork 19
chore(java): bring back test against released MPL version #2226
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
+210
−4
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
19ff8af
Revert "chore: remove test against latest mpl version (#2008)"
rishav-karanjit 1db0ca4
m
rishav-karanjit 1d0b325
Strip SNAPSHOT from MPL dependency version
rishav-karanjit 7d349d4
m
rishav-karanjit 8dc9f05
try changing back
rishav-karanjit 38b6e5d
Revert "try changing back"
rishav-karanjit ba8083e
Merge branch 'main' into bring-back-mpl-test
rishav-karanjit a4023d3
bump mpl
rishav-karanjit be38758
m
rishav-karanjit 8d9292e
m
rishav-karanjit 3a7ac23
m
rishav-karanjit cc8c3ec
m
rishav-karanjit 5693bbc
m
rishav-karanjit 35e611c
m
rishav-karanjit 1368853
Merge branch 'main' into bring-back-mpl-test
rishav-karanjit 50ca859
revert later: to get CI run faster, do this, revert later.
rishav-karanjit 9a61181
Merge branch 'bring-back-mpl-test' of github.com:aws/aws-database-enc…
rishav-karanjit c790c24
m
rishav-karanjit 0dfc46e
m
rishav-karanjit f474d1c
m
rishav-karanjit 22223c0
m
rishav-karanjit 1e6b63b
m
rishav-karanjit e03f0c1
m
rishav-karanjit 19b6bf3
m
rishav-karanjit cac71e6
m
rishav-karanjit bba9ac2
m
rishav-karanjit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,174 @@ | ||
| # This workflow is for testing that the latest released version | ||
| # of the MPL is compatible with the current DB-ESDK Head | ||
| name: Test Latest Released MPL Java with DB-ESDK HEAD | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| dafny: | ||
| description: "The Dafny version to run" | ||
| required: true | ||
| type: string | ||
| regenerate-code: | ||
| description: "Regenerate code using smithy-dafny" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| branch: | ||
| description: "Branch to checkout" | ||
| required: true | ||
| type: string | ||
| run_test_vectors: | ||
| description: "Run Test Vectors?" | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| strip_snapshot: | ||
| description: "Strip -SNAPSHOT suffix from mpl Dependency in project properties?" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| workflow_call: | ||
| inputs: | ||
| dafny: | ||
| description: "The Dafny version to run" | ||
| required: true | ||
| type: string | ||
| regenerate-code: | ||
| description: "Regenerate code using smithy-dafny" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| branch: | ||
| description: "Branch to checkout" | ||
| required: true | ||
| type: string | ||
| run_test_vectors: | ||
| description: "Run Test Vectors?" | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| strip_snapshot: | ||
| description: "Strip -SNAPSHOT suffix from mpl Dependency in project properties?" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| jobs: | ||
| getMplDependencyJavaVersion: | ||
| if: github.repository_owner == 'aws' | ||
| uses: ./.github/workflows/mpl_dependency_java_version.yml | ||
| with: | ||
| strip_snapshot: ${{ inputs.strip_snapshot == true }} | ||
| testJava: | ||
| needs: [getMplDependencyJavaVersion] | ||
| strategy: | ||
| matrix: | ||
| java-version: [17] | ||
| os: [ubuntu-22.04] | ||
| runs-on: ${{ matrix.os }} | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
| steps: | ||
| - name: Configure AWS Credentials | ||
| uses: aws-actions/configure-aws-credentials@v5 | ||
| with: | ||
| aws-region: us-west-2 | ||
| role-to-assume: arn:aws:iam::370957321024:role/GitHub-CI-DDBEC-Dafny-Role-us-west-2 | ||
| role-session-name: DDBEC-Dafny-Java-Tests | ||
|
|
||
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.branch }} | ||
| submodules: recursive | ||
|
|
||
| - name: Setup Java ${{ matrix.java-version }} | ||
| uses: actions/setup-java@v5 | ||
| with: | ||
| distribution: "corretto" | ||
| java-version: ${{ matrix.java-version }} | ||
|
|
||
| - name: Setup Dafny | ||
| uses: ./submodules/MaterialProviders/.github/actions/setup_dafny/ | ||
| with: | ||
| dafny-version: ${{ inputs.dafny }} | ||
|
|
||
| - name: Install Smithy-Dafny codegen dependencies | ||
| uses: ./.github/actions/install_smithy_dafny_codegen_dependencies | ||
|
|
||
| - name: Regenerate code using smithy-dafny if necessary | ||
| if: ${{ inputs.regenerate-code }} | ||
| uses: ./.github/actions/polymorph_codegen | ||
| with: | ||
| dafny: ${{ inputs.dafny }} | ||
| library: DynamoDbEncryption | ||
| diff-generated-code: false | ||
| update-and-regenerate-mpl: true | ||
|
|
||
| - name: Override MPL dependency version | ||
| run: | | ||
| sed -i "s/mplDependencyJavaVersion=.*/mplDependencyJavaVersion=${{ needs.getMplDependencyJavaVersion.outputs.version }}/" project.properties | ||
|
|
||
| # The following two steps: "Build and deploy to maven local" and "Run Extensive Tests" | ||
| # mimic the tests in ./codebuild/staging/release-staging.yml | ||
| - name: Build and deploy to maven local | ||
| shell: bash | ||
| working-directory: ./DynamoDbEncryption | ||
| run: | | ||
| # Run transpile by itself. We don't want to locally build the MPL because | ||
| # we want to verify that the version pulled down from maven works correctly | ||
| make transpile_implementation_java | ||
| make transpile_test_java | ||
| make mvn_local_deploy | ||
| make test_java | ||
|
|
||
| - name: Run Extensive Tests | ||
| working-directory: ./DynamoDbEncryption | ||
| run: | | ||
| gradle -p runtimes/java clean | ||
| gradle -p runtimes/java test | ||
|
|
||
| - name: Update project.properties to use the correct MPL version (from project.properties in DB-ESDK) | ||
| working-directory: ./submodules/MaterialProviders/ | ||
| run: | | ||
| sed "s/javaMPLVersion=.*/javaMPLVersion=${{needs.getMplDependencyJavaVersion.outputs.version}}/g" project.properties > project.properties2; mv project.properties2 project.properties | ||
|
|
||
| # The following three steps: "Transpile MPL Test Vectors without recursively building the MPL", | ||
| # "Run Test Vectors", and "Test Examples" mimic the tests in ./codebuild/staging/validate-staging.yml | ||
| - name: Transpile MPL Test Vectors without recursively building the MPL | ||
| working-directory: ./submodules/MaterialProviders/TestVectorsAwsCryptographicMaterialProviders | ||
| run: | | ||
| # Run transpile by itself. We don't want to locally build the MPL because | ||
| # we want to verify that the version pulled down from maven works correctly | ||
| make transpile_implementation_java | ||
| make transpile_test_java | ||
| make mvn_local_deploy | ||
|
|
||
| - name: Run Test Vectors | ||
| if: inputs.run_test_vectors | ||
| working-directory: ./TestVectors | ||
| run: | | ||
| # Spin up ddb local | ||
| docker run --name dynamodb -d -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -port 8000 -inMemory -cors * | ||
| # Run transpile by itself so we don't locally build the MPL. | ||
| make transpile_implementation_java | ||
| make transpile_test_java | ||
| gradle -p runtimes/java runTests | ||
|
|
||
| - name: Test Examples | ||
| working-directory: ./Examples | ||
| run: | | ||
| gradle -p runtimes/java/DynamoDbEncryption test | ||
| if [[ "${{ inputs.branch }}" == "v3.x-Java" ]]; then | ||
| gradle -p runtimes/java/Migration/PlaintextToAWSDBE test | ||
| gradle -p runtimes/java/Migration/DDBECToAWSDBE test | ||
| else | ||
| gradle -p runtimes/java/DDBECwithSDKV2 test | ||
| gradle -p runtimes/java/Migration/PlaintextToAWSDBE test | ||
| gradle -p runtimes/java/Migration/DDBECv2ToAWSDBE test | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule MaterialProviders
updated
from c57f04 to a4edcd
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command requires latest MPL.
In v3.x-java, latest MPL is coming from #2245