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

CI: CDash dashboard support #5566

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open

Conversation

EZoni
Copy link
Member

@EZoni EZoni commented Jan 15, 2025

@EZoni EZoni added the component: tests Tests and CI label Jan 15, 2025
@EZoni EZoni requested a review from ax3l January 15, 2025 23:26
@ax3l ax3l self-assigned this Jan 15, 2025
CTestConfig.cmake Outdated Show resolved Hide resolved
@ax3l
Copy link
Member

ax3l commented Jan 16, 2025

So far, just adding -DExperimental works to submit to CDash after CTest is done.

But... what if we want to get into the Continuous section instead of the Experimental one, can we do:

cmake -S . -B build  # as before

ctest --test-dir build -D ContinuousStart
ctest --test-dir build -D ContinuousConfigure
ctest --test-dir build -D ContinuousBuild  # instead of cmake --build build?

ctest --test-dir build -D ContinuousTest  # instead of ctest --test-dir build

Still, does not submit and

ctest --test-dir build -D ContinuousSubmit

does not push it out...

@EZoni
Copy link
Member Author

EZoni commented Jan 16, 2025

We actually do see some "Continuous" entries in the dashboard now. Maybe the dashboard displays new ones only once a day after CTEST_NIGHTLY_START_TIME or something like that, while "Experimental" entries are displayed instantaneously...?

"CDash displays results using a 24 hour window", not sure what this means:
Screenshot from 2025-01-16 10-19-13

@EZoni
Copy link
Member Author

EZoni commented Jan 16, 2025

I managed to get some better AI assistance and here's some useful information (to be double checked, of course):

Given that your Azure CI workflow runs ctest for each commit pushed to a PR and each PR merge to the main branch, you might want to use the Experimental dashboard type for the PRs and possibly Continuous or Nightly for the main branch merges.

Why using Experimental for PR events (e.g., push commit to an open PR)?

Experimental Dashboard Type for PRs:

  1. Purpose: The Experimental dashboard type is typically used for ad-hoc testing and development purposes. It is ideal for testing changes that are still under development and have not yet been merged into the main codebase.
  2. Use Case: When a PR is created, it often contains changes that are still being reviewed and may undergo several iterations before being merged. Using the Experimental type for PRs allows you to track the results of these tests separately from the mainline tests. This helps in identifying and addressing issues early in the development process.
  3. Benefits: It helps developers get immediate feedback on their changes without affecting the stability of the main branch's test results. It keeps the main dashboard clean and focused on the stability of the main branch, while still providing visibility into the ongoing development work.

Why using Continuous or Nightly for main branch events (e.g., merge PR into main branch)?

Continuous or Nightly Dashboard Type for Main Branch Merges:

  1. Purpose: The Continuous dashboard type is used for frequent, automated testing of the main codebase. It is suitable for running tests after each commit to the main branch to ensure that the codebase remains stable. The Nightly dashboard type is used for comprehensive testing that runs at a scheduled time each day. It is suitable for running more extensive tests that may take longer to complete.
  2. Use Case: When changes are merged into the main branch, it is crucial to ensure that these changes do not introduce regressions or break existing functionality. Using the Continuous type for main branch merges allows for immediate testing and feedback on the stability of the main codebase. Using the Nightly type (if applicable) allows for more thorough testing, such as running a full suite of tests or performing additional checks that may not be feasible to run on every commit.
  3. Benefits: It ensures that the main branch remains stable and reliable, as any issues introduced by recent changes can be quickly identified and addressed. It provides a clear and consistent view of the health of the main codebase over time.

Comment on lines 158 to 166
# determine if the build was triggered by a push to the development branch
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
# run tests (exclude pytest.AMReX when running Python tests)
# and submit results to CDash as Continuous
ctest --test-dir build --output-on-failure -E AMReX -D Continuous
else
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
fi
Copy link
Member Author

@EZoni EZoni Jan 16, 2025

Choose a reason for hiding this comment

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

This is what I would try first, based on the information reported in #5566 (comment).

Update
This is probably duplicating the configure and build step. Looking more into how to avoid duplication.

Copy link
Member Author

Choose a reason for hiding this comment

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

Again on this, and on the issues reported in #5566 (comment), reading the documentation more carefully it seems to me that the various "steps" (e.g., Start, Update, Configure, Build, Test, MemoryCheck, Coverage, Submit) can be run independently only for the Nightly or Experimental modes, but not for the other modes such as Continuous. This could explain what we observed so far.

Screenshot from 2025-01-17 11-09-18

Copy link
Member Author

@EZoni EZoni Jan 17, 2025

Choose a reason for hiding this comment

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

Continuous still seems like the right choice for main branch events, such as merging PRs into the main branch, from a theoretical point of view. But, as discussed, we could start with Experimental and fine tune things later on, once we have gained more experience with CDash overall.

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
# determine if the build was triggered by a push to the development branch
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
# run tests (exclude pytest.AMReX when running Python tests)
# and submit results to CDash as Continuous
ctest --test-dir build --output-on-failure -E AMReX -D Continuous
else
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
fi
# determine if the build was triggered by a push to the development branch
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
# run tests (exclude pytest.AMReX when running Python tests)
# and submit results to CDash as Experimental
ctest --test-dir build --output-on-failure -E AMReX \
-D ExperimentalTest -D ExperimentalSubmit
else
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
fi

Comment on lines +16 to +18
# Additional settings
set(CTEST_SITE "Azure-Pipelines")
set(CTEST_BUILD_NAME "CI-Development")
Copy link
Member Author

Choose a reason for hiding this comment

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

These site and build names would be displayed as follows:

Screenshot from 2025-01-16 11-03-04

@EZoni EZoni changed the title [WIP] CDash dashboard support CDash dashboard support Jan 16, 2025
@EZoni EZoni added the enhancement New feature or request label Jan 16, 2025
@EZoni EZoni changed the title CDash dashboard support [WIP] CDash dashboard support Jan 17, 2025
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
# determine if the build was triggered by a push to the development branch
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
Copy link
Member Author

@EZoni EZoni Jan 17, 2025

Choose a reason for hiding this comment

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

If this does not work (but we'll know only after merging the PR into development), we can also try the following (see https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables for more documentation):

Suggested change
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
if [[ "$(Build.Reason)" == "IndividualCI" ]]; then

@EZoni EZoni changed the title [WIP] CDash dashboard support CDash dashboard support Jan 17, 2025
@EZoni EZoni changed the title CDash dashboard support CI: CDash dashboard support Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tests Tests and CI enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CTest follow-up: add basic performance tracking
2 participants