Skip to content

Consistent naming of mocks - #457

Merged
MaciejKaszynski merged 2 commits into
eclipse-score:mainfrom
etas-contrib:use-common-mock-names
Aug 12, 2026
Merged

MaciejKaszynski merged 2 commits into
eclipse-score:mainfrom
etas-contrib:use-common-mock-names

Conversation

@cameron-craig-etas

@cameron-craig-etas cameron-craig-etas commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

#422

This PR tidies up the naming of our mocks. I have gone with the mock_ prefix convention, as it:

  • conforms to GTest conventions of mock_component files and MockComponent classes.
  • is an existing style used within the code base, just not consistently

(Feel free to suggest an alternative naming convention. This is just what made sense to me)

This is a breaking change because mocks under score/launch_manager/src/lifecycle_client/src/ are exposed to users.

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 7d2b15b1-30ad-4dcf-bf04-6d7f25d4ec93
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 1 packages loaded
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (36 packages loaded, 10 targets configured)

Analyzing: target //:license-check (90 packages loaded, 10 targets configured)

Analyzing: target //:license-check (104 packages loaded, 50 targets configured)

Analyzing: target //:license-check (150 packages loaded, 3143 targets configured)

Analyzing: target //:license-check (159 packages loaded, 6913 targets configured)

Analyzing: target //:license-check (170 packages loaded, 9397 targets configured)

Analyzing: target //:license-check (170 packages loaded, 9397 targets configured)

Analyzing: target //:license-check (172 packages loaded, 9522 targets configured)

INFO: Analyzed target //:license-check (175 packages loaded, 11535 targets configured).
[12 / 16] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 26.106s, Critical Path: 2.50s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown
Contributor

The created documentation from the pull request is available at: docu-html

@TimoSteuerwaldETAS

Copy link
Copy Markdown
Contributor

I like the prefix convention. 👍

However for the integration tests, I would prefer using completely different names here.
In fact these aren't Mocks at all, these are rather Stubs or Fake objects.
See also: Mocks Aren't Stubs

What do you think?

It is not needed to be done in this PR. I can also add a github issue for that and for conformity just leave it as proposed by you. :-)

Renaming to ControlClientStub or ControlClientFake would involve more than just a file rename anyways.

@cameron-craig-etas

Copy link
Copy Markdown
Contributor Author

I like the prefix convention. 👍

However for the integration tests, I would prefer using completely different names here. In fact these aren't Mocks at all, these are rather Stubs or Fake objects. See also: Mocks Aren't Stubs

What do you think?

It is not needed to be done in this PR. I can also add a github issue for that and for conformity just leave it as proposed by you. :-)

Renaming to ControlClientStub or ControlClientFake would involve more than just a file rename anyways.

Ah ok, I haven't looked too deep into these files, so I hadn't spotted that. I agree that these mocks, stubs (or whatever they may be) should be named more appropriately. I'll do this in a follow-up PR to prevent this one from getting any bigger.

@TimoSteuerwaldETAS TimoSteuerwaldETAS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Created successor story for renaming the MockControlClients to Stubs: #458

Beside that, everything is fine.

@MaciejKaszynski
MaciejKaszynski merged commit 18d99ad into eclipse-score:main Aug 12, 2026
20 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in LCM - Lifecycle & Health FT Aug 12, 2026

This branch was successfully deployed

1 active deployment
workflow-approval 2bb384f6 Deployed Aug 12, 2026 by cameron-craig-etas via Build and Test unit-tests-arm64-qnx / approval #774
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants