Skip to content

Commit

Permalink
Add GHA workflow for new tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Miles-Garnsey authored and adejanovski committed Sep 6, 2023
1 parent be3b67d commit 82a83ac
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 25 deletions.
6 changes: 2 additions & 4 deletions .github/scripts/configure-ccm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ case "${TEST_TYPE}" in
echo "ERROR: Environment variable TEST_TYPE is unspecified."
exit 1
;;
"ccm"|"upgrade"|"elassandra")
"ccm"|"upgrade"|"elassandra"|"http-api")
mkdir -p ~/.local
cp ./.github/files/jmxremote.password ~/.local/jmxremote.password
chmod 400 ~/.local/jmxremote.password
Expand Down Expand Up @@ -115,6 +115,4 @@ case "${TEST_TYPE}" in
;;
*)
echo "Skipping, no actions for TEST_TYPE=${TEST_TYPE}."
esac


esac
28 changes: 27 additions & 1 deletion .github/scripts/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,32 @@ case "${TEST_TYPE}" in
esac

;;
"http-api")
mvn --version -B
ps uax | grep cass
# dependending on the version of cassandra, we may need to use a different jdk
set_java_home ${JDK_VERSION}
ccm start -v --no-wait --skip-wait-other-notice || true
echo "${TEST_TYPE}" | grep -q ccm && sleep 30 || sleep 120
ccm status
ccm node1 nodetool -- -u cassandra -pw cassandrapassword status
# Reaper requires JDK11 for compilation
set_java_home 11
case "${STORAGE_TYPE}" in
"")
echo "ERROR: Environment variable STORAGE_TYPE is unspecified."
exit 1
;;
"local")
mvn -B package -DskipTests
mvn -B org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:prepare-agent surefire:test -DsurefireArgLine="-Xmx256m" -Dtest=ReaperHttpIT -Dcucumber.options="$CUCUMBER_OPTIONS" org.jacoco:jacoco-maven-plugin:${JACOCO_VERSION}:report
;;
*)
echo "Skipping, no actions for STORAGE_TYPE=${STORAGE_TYPE}."
;;
esac

;;
"sidecar")
mvn --version -B
mvn -B package -DskipTests
Expand Down Expand Up @@ -173,4 +199,4 @@ case "${TEST_TYPE}" in
;;
*)
echo "Skipping, no actions for TEST_TYPE=${TEST_TYPE}."
esac
esac
56 changes: 55 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,61 @@ jobs:

- uses: codecov/codecov-action@v1

its-http-management:
needs: [ build ]
name: HTTP Management
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
cassandra-version: [ 'binary:3.11.11', 'binary:4.0.1' ]
storage-type: [ local ]
test-type: [ "http-api" ]
grim-max: [ 1 ]
grim-min: [ 1 ]
# all versions but trunk have the same cucumber options, but we can't declare that more effectively (yet)
include:
- cassandra-version: 'binary:3.11.11'
cucumber-options: '--tags ~@cassandra_4_0_onwards --tags @http_management'
experimental: false
jdk-version: '8'
- cassandra-version: 'binary:4.0.1'
cucumber-options: '--tags @http_management'
experimental: false
jdk-version: '11'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup

- name: Install CCM
run: |
pip install pyyaml
pip install ccm
- name: Setup CCM Cluster
run: ./.github/scripts/configure-ccm.sh
env:
TEST_TYPE: ${{ matrix.test-type }}
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
STORAGE_TYPE: ${{ matrix.storage-type }}
JDK_VERSION: ${{ matrix.jdk-version }}

- name: Run Tests
run: ./.github/scripts/run-tests.sh || ./.github/scripts/run-tests.sh
env:
TEST_TYPE: ${{ matrix.test-type }}
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
STORAGE_TYPE: ${{ matrix.storage-type }}
GRIM_MAX: ${{ matrix.grim-max }}
GRIM_MIN: ${{ matrix.grim-min }}
CUCUMBER_OPTIONS: ${{ matrix.cucumber-options }}
JDK_VERSION: ${{ matrix.jdk-version }}

- uses: codecov/codecov-action@v1

its-each:
needs: [docker-tests, its-ccm-local, its-ccm-cass]
name: Each DC Availability
Expand Down Expand Up @@ -386,7 +441,6 @@ jobs:

- uses: codecov/codecov-action@v1


its-flapping:
needs: [docker-tests, its-ccm-local, its-ccm-cass]
name: Flapping reapers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Feature: Using Reaper
And cluster "test" has keyspace "test_keyspace2" with tables "test_table1, test_table2"
And cluster "test" has keyspace "test_keyspace3" with tables "test_table1, test_table2"

@all_nodes_reachable
@all_nodes_reachable
@cassandra_3_11_onwards
@snapshots
@http_management
Expand All @@ -43,7 +43,7 @@ Feature: Using Reaper
Then there is 0 snapshot returned when listing snapshots
When the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@all_nodes_reachable
@cassandra_3_11_onwards
Expand All @@ -66,7 +66,7 @@ Feature: Using Reaper
Then there is 0 snapshot returned when listing snapshots
When the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@http_management
Expand All @@ -88,7 +88,7 @@ Feature: Using Reaper
When the last added cluster is force deleted
And reaper has 0 scheduled repairs for cluster called "test"
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@cassandra_3_11_onwards
Expand All @@ -111,7 +111,7 @@ Feature: Using Reaper
When the last added schedule is deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@http_management
Expand All @@ -138,7 +138,7 @@ Feature: Using Reaper
When all added schedules are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@all_nodes_reachable
Expand All @@ -158,7 +158,7 @@ Feature: Using Reaper
When all added schedules are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@all_nodes_reachable
Expand All @@ -179,7 +179,7 @@ Feature: Using Reaper
When all added schedules are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@all_nodes_reachable
Expand All @@ -199,7 +199,7 @@ Feature: Using Reaper
When all added schedules are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@cassandra_3_11_onwards
Expand All @@ -223,7 +223,7 @@ Feature: Using Reaper
When all added schedules are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@cassandra_3_11_onwards
Expand All @@ -246,11 +246,10 @@ Feature: Using Reaper
And all added repair runs are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}

# this has a problem in the upgrade integration tests, ref: 88d4d5c
@cassandra_3_11_onwards
@http_management
# this has a problem in the upgrade integration tests, ref: 88d4d5c
Scenario Outline: Create a cluster and a repair run with auto twcs blacklist and delete them
Given that reaper <version> is running
And reaper has no cluster in storage
Expand All @@ -268,7 +267,6 @@ Feature: Using Reaper
And all added repair runs are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}

@sidecar
@all_nodes_reachable
Expand All @@ -295,7 +293,7 @@ Feature: Using Reaper
And all added repair runs are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@all_nodes_reachable
Expand All @@ -321,7 +319,7 @@ Feature: Using Reaper
When all added repair runs are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@all_nodes_reachable
@cassandra_3_11_onwards
Expand Down Expand Up @@ -371,7 +369,7 @@ Feature: Using Reaper
And all added repair runs are deleted for the last added cluster
And the last added cluster is deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@all_nodes_reachable
Expand Down Expand Up @@ -404,7 +402,7 @@ Feature: Using Reaper
And I cannot start an unknown schedule
When the last added cluster is force deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}


@sidecar
@cassandra_3_11_onwards
Expand All @@ -428,5 +426,4 @@ Feature: Using Reaper
When I list the last 10 repairs, I can see 4 repairs at "PAUSED" state
When I list the last 10 repairs, I can see 6 repairs at "ABORTED" state
When the last added cluster is force deleted
Then reaper has no longer the last added cluster in storage
${cucumber.upgrade-versions}
Then reaper has no longer the last added cluster in storage

0 comments on commit 82a83ac

Please sign in to comment.