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

Test probe only #923

Merged
merged 2 commits into from
Apr 8, 2024
Merged

Test probe only #923

merged 2 commits into from
Apr 8, 2024

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Jan 17, 2024

Way back in #765, I submitted some patches to fix the GAMMARAY_CLIENT_ONLY_BUILD, which had stealth-broken because it wasn't being tested in CI.

The same is now true of GAMMARAY_PROBE_ONLY_BUILD, so to avoid the possibility of similar stealth breakage, this PR adds test runs for probe-only builds to the standard CI, by first adding configurations for them to the CMakePresets.json.

Along the way, it makes some adjustments to the existing configuration(s), to facilitate adding additional CI build configurations

Presets file CMakePresets.json

  1. The presets file is adjusted to make better use of inheritance, removing duplicate manual settings of "generator" or "binaryDir" when those can simply be inherited.
  2. To keep the file more streamlined, the new configs (and any they depend on) take advantage of a CMake feature that permits a string value for "inherits", rather than a list value, when only one configuration is being inherited from.

(Not all configurations were adjusted, mostly just the ones I was touching anyway. But in both cases, they all could be changed the same way.)

CI configuration build.yml

  1. To control whether (and which type) of unit tests are run, a new matrix.config.tests_with value is optionally added to matrix members, set to either qt5 or qt6.
    This allows the complicated version checks:
    startsWith(matrix.config.qt_version, '6.')
    to be replaced with a simple:
    matrix.config.tests_with == 'qt6'
    and (along with runner.os) not only controls which tests are run, but its absence will prevent tests from being run at all. (Mostly because unit tests on a PROBE_ONLY build are simultaneously both pointless and redundant.)

.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
.github/workflows/build.yml Outdated Show resolved Hide resolved
@ferdnyc ferdnyc requested a review from dantti January 17, 2024 02:05
Copy link
Member

@dantti dantti left a comment

Choose a reason for hiding this comment

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

LGTM

@winterz
Copy link
Member

winterz commented Apr 5, 2024

@ferdnyc would you fix the conflicts please.
I'm sorry we forgot to merge this one and now we have a few conflicts

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Apr 8, 2024

@winterz Sorry for the delay, will do.

- Use inheritance to avoid repeating 'generator' and 'binaryDir'
- Take advantage of 'inherits' feature that allows specifying a
  string, rather than a list, if inheriting only one config
- Add configurations for ci-dev-probe-only-qt5 and -qt6.
- Also add additional workflow parameter 'matrix.config.tests_with',
  which is set to either 'qt5' or 'qt6' if tests should be run for
  a particular configuration.
- Update unit test 'if:' parameters to use 'matrix.config.tests_with'

- Only perform the "enable gdb attaching" steps if unit tests are
  going to be run.

- Enable unit tests for client-and-ui builds
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Apr 8, 2024

@winterz Done. I took the opportunity to squash some of the back-and-forth away, since I had to rewrite all of the commits to rebase the branch.

@winterz
Copy link
Member

winterz commented Apr 8, 2024

the 2 CI failures are related to KDStateMachineEditor dependency which we're still working.

@winterz winterz merged commit ab800c7 into KDAB:master Apr 8, 2024
18 of 20 checks passed
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.

3 participants