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

1057 trigger running foxx tests as part of ci #1059

Conversation

JoshuaSBrown
Copy link
Collaborator

@JoshuaSBrown JoshuaSBrown commented Nov 7, 2024

Description

The CI pipeline even though enabling the foxx tests does not have an option to run them.

Summary by Sourcery

CI:

  • Add configuration to enable Foxx tests in the CI pipeline by setting the ENABLE_FOXX_TESTS environment variable.

Copy link

sourcery-ai bot commented Nov 7, 2024

Reviewer's Guide by Sourcery

This PR implements the ability to run Foxx tests as part of the CI pipeline. The implementation adds a new CMake option ENABLE_FOXX_TESTS and modifies the Docker entrypoint script to conditionally run tests when this option is enabled. The changes also include updating the CI configuration to enable these tests.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added new CMake option for enabling Foxx tests
  • Added ENABLE_FOXX_TESTS CMake option with default value FALSE
  • Added warning comment that enabling tests will overwrite the test database
CMakeLists.txt
Modified Docker entrypoint script to handle Foxx test execution
  • Added conditional CMake configuration based on ENABLE_FOXX_TESTS environment variable
  • Added test execution step when ENABLE_FOXX_TESTS is TRUE
  • Split CMake configuration into two paths for test and non-test builds
docker/entrypoint_foxx.sh
Updated CI pipeline configuration to enable Foxx tests
  • Added ENABLE_FOXX_TESTS environment variable to Docker container configuration
.gitlab/end_to_end.yml
Updated changelog with new feature
  • Added entry for enabling Foxx tests in CI
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@JoshuaSBrown JoshuaSBrown self-assigned this Nov 7, 2024
@JoshuaSBrown JoshuaSBrown linked an issue Nov 7, 2024 that may be closed by this pull request
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @JoshuaSBrown - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

-DBUILD_DOCS=False \
-DBUILD_PYTHON_CLIENT=False \
-DBUILD_FOXX=True \
-DINSTALL_FOXX=True
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider consolidating the duplicate CMake configuration to reduce maintenance burden

The CMake configuration is identical between both branches except for -DENABLE_FOXX_TESTS. Consider moving the common arguments before the if statement and only conditionally adding the test flag.

# Check to see if foxx has previously been installed
"${PROJECT_ROOT}/scripts/generate_datafed.sh"

CMAKE_ARGS="-DBUILD_REPO_SERVER=False -DBUILD_COMMON=False -DBUILD_AUTHZ=False -DBUILD_CORE_SERVER=False -DBUILD_WEB_SERVER=False -DBUILD_DOCS=False -DBUILD_PYTHON_CLIENT=False -DBUILD_FOXX=True -DINSTALL_FOXX=True"

if [ "$ENABLE_FOXX_TESTS" == "TRUE" ]; then
  "${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake" -S. -B build ${CMAKE_ARGS} -DENABLE_FOXX_TESTS=True
else
  "${DATAFED_DEPENDENCIES_INSTALL_PATH}/bin/cmake" -S. -B build ${CMAKE_ARGS}
fi

@@ -55,6 +70,13 @@
touch "$install_flag"
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Move install flag creation after test execution to ensure installation is only marked complete on test success

Currently, the installation is marked as complete before running tests. If tests fail, the installation should not be considered successful. Consider moving the install flag creation after the test execution block.

JoshuaSBrown and others added 19 commits November 7, 2024 16:21
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
…tup-container-to-stdout

Add log output from ci end-to-end arango-setup job
…-node-setup-job

1073 add missing deployment key to node setup job
grab log output even if container fails
move flag to the correct position after ps
@JoshuaSBrown JoshuaSBrown changed the base branch from devel to 1031-foxx-test-variable November 14, 2024 18:19
@JoshuaSBrown JoshuaSBrown changed the base branch from 1031-foxx-test-variable to 1056-foxx-test-script-fix November 14, 2024 18:21
@JoshuaSBrown JoshuaSBrown merged commit 6d9f332 into 1056-foxx-test-script-fix Nov 14, 2024
11 of 12 checks passed
@JoshuaSBrown JoshuaSBrown deleted the 1057-trigger-running-foxx-tests-as-part-of-ci branch November 14, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Foxx, CI] - Run foxx tests as part of CI pipeline
1 participant