-
Notifications
You must be signed in to change notification settings - Fork 348
Generalize Backwards Compatibility tests so we can test from any version to any version #2253
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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,43 @@ | ||
| name: 'Create a backwards compatible ready build' | ||
| description: 'Checkouts the official version of a the Security plugin and builds it so it can be used for BWC tests' | ||
|
|
||
| inputs: | ||
| plugin-branch: | ||
| description: 'The branch of the plugin that should be built, e.g "2.2", "1.x"' | ||
| required: true | ||
|
|
||
| outputs: | ||
| built-version: | ||
| description: 'The version of OpenSearch that was associated with this branch' | ||
| value: ${{ steps.get-opensearch-version.outputs.version }} | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Enable Longpaths if on Windows | ||
| if: ${{ runner.os == 'Windows' }} | ||
| run: git config --system core.longpaths true | ||
| shell: pwsh | ||
|
|
||
| - uses: actions/checkout@v3 | ||
| with: | ||
| repository: opensearch-project/security | ||
| ref: ${{ inputs.plugin-branch }} | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| path: ${{ inputs.plugin-branch }} | ||
|
|
||
| - name: Build | ||
| uses: gradle/gradle-build-action@v2 | ||
| with: | ||
| arguments: assemble -Dbuild.snapshot=false | ||
| build-root-directory: ${{ inputs.plugin-branch }} | ||
|
|
||
| - id: get-opensearch-version | ||
| uses: peternied/get-opensearch-version@v1 | ||
| with: | ||
| working-directory: ${{ inputs.plugin-branch }} | ||
|
|
||
| - name: Copy current distro into the expected folder | ||
| run: | | ||
| mkdir -p ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.version }} | ||
| cp ${{ inputs.plugin-branch }}/build/distributions/opensearch-security-${{ steps.get-opensearch-version.outputs.version }}.zip ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.version }} | ||
| shell: bash | ||
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,46 @@ | ||
| name: 'Runs the backward bompatiblity test suite' | ||
| description: 'Tests backwards compability between a previous and next version of this plugin' | ||
|
|
||
| inputs: | ||
| plugin-previous-branch: | ||
| description: 'The branch of the plugin that should be built for the previous version, e.g "2.2", "1.x"' | ||
| required: true | ||
|
|
||
| plugin-next-branch: | ||
| description: 'The branch of the plugin that should be built for the next version, e.g "2.3", "main"' | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| required: true | ||
|
|
||
| report-artifact-name: | ||
| description: 'The name of the artifacts for this run, e.g. "BWC-2.1-to-2.4-results"' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
|
|
||
| - id: build-previous | ||
| uses: ./.github/actions/create-bwc-build | ||
| with: | ||
| plugin-branch: ${{ inputs.plugin-previous-branch }} | ||
|
|
||
| - id: build-next | ||
| uses: ./.github/actions/create-bwc-build | ||
| with: | ||
| plugin-branch: ${{ inputs.plugin-next-branch }} | ||
|
|
||
| - name: Run BWC tests | ||
| uses: gradle/gradle-build-action@v2 | ||
| with: | ||
| arguments: | | ||
| bwcTestSuite | ||
| -Dtests.security.manager=false | ||
| -Dbwc.version.previous=${{ steps.build-previous.outputs.built-version }} | ||
| -Dbwc.version.next=${{ steps.build-next.outputs.built-version }} -i | ||
| build-root-directory: bwc-test | ||
|
|
||
| - uses: actions/upload-artifact@v3 | ||
| if: always() | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| name: ${{ inputs.report-artifact-name }} | ||
| path: | | ||
| ./bwc-test/build/reports/ | ||
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,42 @@ | ||
| name: Backwards Compability Suite | ||
|
|
||
| on: [workflow_dispatch] | ||
|
|
||
| jobs: | ||
| last-supported-major-to-current: | ||
| name: Make sure that the last supported major version can move to the most current version | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/setup-java@v1 | ||
| with: | ||
| java-version: 11 | ||
peternied marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Checkout Security Repo | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - id: build-previous | ||
| uses: ./.github/actions/run-bwc-suite | ||
| with: | ||
| plugin-previous-branch: "1.3" | ||
| plugin-next-branch: "2.x" | ||
| report-artifact-name: BWC-Last-Supported-Major | ||
|
|
||
| current-to-next-unreleased-major: | ||
| name: Make sure that the current version is compatible with the next major version | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/setup-java@v1 | ||
| with: | ||
| java-version: 11 | ||
|
|
||
| - name: Checkout Security Repo | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - id: build-previous | ||
| uses: ./.github/actions/run-bwc-suite | ||
| with: | ||
| plugin-previous-branch: "2.x" | ||
| plugin-next-branch: "main" | ||
| report-artifact-name: BWC-Next-Major | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.