-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generalize Backwards Compatibility tests so we can test from any vers…
…ion to any version With an issue reported indicating that there are serialization issue between 1.3 and 2.X, making sure that we can reproduce the errors. This new workflow(s) will make sure that we aren't breaking BWC with changes we are adding to 2.X and will give us the flexibility to test certain migration workflows. Fixing an issue where the BWC tests were not actually building or executing causing the clusters to spin up and then immediately spin down. We will need to invest more energy into running multiple kinds of security plugin specific scenarios through the test system. Signed-off-by: Peter Nied <[email protected]>
- Loading branch information
Showing
6 changed files
with
204 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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,47 @@ | ||
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.built-version }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
# Configure longpath names if on Windows | ||
- 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 }} | ||
path: ${{ inputs.plugin-branch }} | ||
|
||
- name: Build | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
arguments: assemble -Dbuild.snapshot=false | ||
build-root-directory: ${{ inputs.plugin-branch }} | ||
|
||
# This might not work in windows | ||
- id: get-opensearch-version | ||
run: | | ||
export extractedVersion=$(./gradlew properties -Dbuild.snapshot=false | grep ^version: | awk '{split($0, a, ": ");print a[2]}') | ||
echo "::set-output name=built-version::$extractedVersion" | ||
working-directory: ${{ inputs.plugin-branch }} | ||
shell: bash | ||
|
||
- name: Copy current distro into the expected folder | ||
run: | | ||
mkdir -p ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.built-version }} | ||
cp ${{ inputs.plugin-branch }}/build/distributions/opensearch-security-${{ steps.get-opensearch-version.outputs.built-version }}.zip ./bwc-test/src/test/resources/${{ steps.get-opensearch-version.outputs.built-version }} | ||
shell: bash |
This file contains 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: '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-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"' | ||
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() | ||
with: | ||
name: ${{ inputs.report-artifact-name }} | ||
path: | | ||
./bwc-test/build/reports/ |
This file contains 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: | ||
name: Make sure that the last supported major version can mov | ||
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: "1.3" | ||
plugin-next-branch: "2.x" | ||
report-artifact-name: BWC-Last-Supported-Major | ||
|
||
next-major: | ||
name: Make sure that the current version is compatible with | ||
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 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 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.