-
Notifications
You must be signed in to change notification settings - Fork 622
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
base: trunk
Are you sure you want to change the base?
Conversation
lukasz-antoniak
commented
Oct 17, 2024
•
edited
Loading
edited
- Java 17 is installed for future testing.
- C* 4.0.13 fails to start with CCM if only Java 17 is available.
- Creating environment variables expected by CCM.
ff06373
to
60a2022
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
.github/workflows/main.yml
Outdated
- name: Install Java | ||
run: | | ||
curl -s "https://get.sdkman.io" | bash | ||
source "$HOME/.sdkman/bin/sdkman-init.sh" | ||
echo "sdkman_auto_answer=true" >> ~/.sdkman/etc/config | ||
# sdk list java | ||
|
||
sdk install java 11.0.24-zulu | ||
echo "JAVA11_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV | ||
|
||
sdk install java 17.0.12-zulu | ||
echo "JAVA17_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV | ||
|
||
# by default use JDK 11 | ||
sdk default java 11.0.24-zulu | ||
sdk use java 11.0.24-zulu | ||
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV | ||
echo "PATH=$PATH" >> $GITHUB_ENV | ||
- name: Install CCM | ||
run: pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}" | ||
run: | | ||
python3 -m venv ~/venv | ||
~/venv/bin/pip install setuptools | ||
~/venv/bin/pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about an idea to create a separate script file to combine the duplicated installation steps for Java and CCM? You can then reuse this script across all jobs for setup. It will reduce duplication and centralize maintenance. This way, if you need to update the installation logic for Java or CCM in the future, you can do it in one place instead of multiple jobs. The workflow becomes more nice and readable with a simple call to the script.
Adding caching to the installation process can speed up builds by reusing dependencies (e.g., SDKMAN, Java versions, Python packages) across workflow runs.
I’ve put together an example of this approach, which you can check out here: ribaraka#26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that approach but just to clarify, the PR you linked is not a complete "replacement" to what we have because it's missing a few things like cassandra.yaml customization, the commands to run the tests, etc. It's meant more as an example of what could be incorporated to this current PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I quickly put together an example to clarify the idea.
The GH action is failing justfyi |
abb1a71
to
0983f99
Compare
0983f99
to
8afd41d
Compare
Yes, I was actively developing it. @ribaraka, I have refactored the code to GitHub action instead of shell script. This way I do not need to repeat caching steps. |
pip install --upgrade pip setuptools | ||
|
||
echo "Installing CCM..." | ||
pip install "git+https://github.com/riptano/ccm.git@${CCM_VERSION}" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.