Skip to content

Commit

Permalink
Don't use container for the bwc tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Widdis <[email protected]>
  • Loading branch information
dbwiddis committed Mar 7, 2024
1 parent e6c2f41 commit 6b18d84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/test_bwc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,43 @@ on:
push:
branches:
- "**"
- "!main"
pull_request:
branches:
- "**"
- "!main"

jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

Build-ad-linux:
needs: Get-CI-Image-Tag
Build-ff-linux:
strategy:
matrix:
java: [11,17,21]
fail-fast: false

name: Test Flow Framework BWC
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
# this image tag is subject to change as more dependencies and updates will arrive over time
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Checkout Flow Framework
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Assemble flow-framework
- name: Assemble Flow Framework
run: |
plugin_version=`./gradlew properties -q | grep "opensearch_build:" | awk '{print $2}'`
chown -R 1000:1000 `pwd`
echo plugin_version $plugin_version
su `id -un 1000` -c "./gradlew assemble"
./gradlew assemble
echo "Creating ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version ..."
su `id -un 1000` -c "mkdir -p ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version"
mkdir -p ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version
echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version ..."
ls ./build/distributions/
su `id -un 1000` -c "cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version"
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version
echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version ..."
ls ./src/test/resources/org/opensearch/flowframework/bwc/flow-framework/$plugin_version
- name: Run Flow Framework Backwards Compatibility Tests
run: |
echo "Running backwards compatibility tests ..."
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew bwcTestSuite -Dtests.security.manager=false"
./gradlew bwcTestSuite -Dtests.security.manager=false
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import java.nio.file.Paths
buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
bwcVersionShort = "2.12.0"
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
version_tokens = opensearch_version.tokenize('-')
Expand Down Expand Up @@ -583,7 +584,7 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) {
testClusters."${baseName}1".upgradeAllNodesAndPluginsToNextVersion(plugins)
}
filter {
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
includeTestsMatching "org.opensearch.flowframework.bwc.*IT"
}
systemProperty 'tests.rest.bwcsuite', 'upgraded_cluster'
systemProperty 'tests.plugin_bwc_version', bwcVersion
Expand All @@ -595,6 +596,7 @@ task "${baseName}#fullRestartClusterTask"(type: StandaloneRestIntegTestTask) {
task bwcTestSuite(type: StandaloneRestIntegTestTask) {
exclude '**/*Test*'
exclude '**/*IT*'

dependsOn tasks.named("${baseName}#mixedClusterTask")
dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask")
dependsOn tasks.named("${baseName}#fullRestartClusterTask")
Expand Down

0 comments on commit 6b18d84

Please sign in to comment.