Skip to content
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

CASSGO-20 Fix integration tests #1833

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/actions/setup-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Setup environment
description: Setup environment for integration tests execution
runs:
using: "composite"
steps:
- name: Set up cache for SDKMAN
uses: actions/cache@v3
with:
path: ~/.sdkman
key: ${{ runner.os }}-sdkman

- name: Set up cache for PIP
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Java
shell: bash
run: |
echo "Installing SDKMAN..."
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
echo "sdkman_auto_answer=true" >> ~/.sdkman/etc/config
echo "Installing Java versions..."
sdk install java 11.0.24-zulu
sdk install java 17.0.12-zulu
sdk default java 11.0.24-zulu
sdk use java 11.0.24-zulu
echo "JAVA11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "JAVA17_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Install CCM
shell: bash
run: |
echo "Creating Python virtual environment..."
VENV_DIR="$HOME/venv"
python3 -m venv $VENV_DIR
source $VENV_DIR/bin/activate
pip install --upgrade pip setuptools
echo "Installing CCM..."
pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No newline at end of file.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, there's no newline in the .github/workflows/main.yml file, so I assume it's not required.

12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install CCM
run: pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}"
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Start cassandra nodes
run: |
source ~/venv/bin/activate
VERSION=${{ matrix.cassandra_version }}
keypath="$(pwd)/testdata/pki"
conf=(
Expand Down Expand Up @@ -107,6 +108,7 @@ jobs:
echo "JVM_EXTRA_OPTS=$JVM_EXTRA_OPTS" >> $GITHUB_ENV
- name: Integration tests
run: |
source ~/venv/bin/activate
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
go test -v -tags "${{ matrix.tags }} gocql_debug" -timeout=5m -race ${{ env.args }}
- name: 'Save ccm logs'
Expand Down Expand Up @@ -135,10 +137,11 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install CCM
run: pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}"
- name: Setup environment
uses: ./.github/actions/setup-environment
- name: Start cassandra nodes
run: |
source ~/venv/bin/activate
VERSION=${{ matrix.cassandra_version }}
keypath="$(pwd)/testdata/pki"
conf=(
Expand Down Expand Up @@ -197,5 +200,6 @@ jobs:
sleep 30s
- name: Integration tests
run: |
source ~/venv/bin/activate
export JVM_EXTRA_OPTS="${{env.JVM_EXTRA_OPTS}}"
go test -v -run=TestAuthentication -tags "${{ matrix.tags }} gocql_debug" -timeout=15s -runauth ${{ env.args }}
Loading