Skip to content

Make the build pass on a clean checkout, then run it in CI - #1

Merged
qualv13 merged 2 commits into
masterfrom
chore/ci
Aug 23, 2026
Merged

qualv13 merged 2 commits into
masterfrom
chore/ci

Conversation

@qualv13

@qualv13 qualv13 commented Aug 23, 2026

Copy link
Copy Markdown
Owner

mvn test fails on a fresh clone of the current default branch. The one live test cannot start the Spring context: application-test.yaml carries no cloudflare.r2.* keys, and IoTServerAppApplicationTests never activated the test profile in the first place, so it loaded production config and looked for keys that only exist in the deployment environment.

What changed

  • application-test.yaml now describes something that exists on a clean machine: H2 in memory, the MQTT client mocked out, placeholder R2 values. It previously pointed at a Postgres on localhost:5438 and a public MQTT broker.
  • IoTServerAppApplicationTests activates the test profile.
  • With the context starting, five parked test classes come back with nothing but uncommenting. 1 failing test becomes 9 passing ones.
  • CI runs ./mvnw verify on Temurin 17 for every push and pull request. No services, no secrets.
  • Adds MIT.

Please rotate the MQTT broker credentials. The old application-test.yaml had the broker host, username and password in it. Removing them from the current file does not remove them from the history of a public repository.

What is deliberately not in this PR

Six test classes stay commented out. They compile and run; 7 assertions have drifted from what the endpoints return today, LampService gained two constructor arguments, and MqttListenerServiceTest tests a service that is itself commented out. The README now lists each one and why, instead of the previous "the test suite is disabled". Deciding the new expected values is a separate job from getting the build green, and it is yours to make rather than mine to guess.

`mvn test` failed on a fresh clone. The one live test could not start the
context: `application-test.yaml` had no `cloudflare.r2.*` keys, and
IoTServerAppApplicationTests never activated the test profile anyway, so it
was loading production config and looking for keys that only exist in the
deployment environment.

The test profile now describes something that actually exists on a clean
machine: H2 in memory, the MQTT client mocked, placeholder R2 values. It used
to point at a Postgres on localhost:5438 and a public MQTT broker, with the
broker username and password in the file. Those credentials are still in the
history of this repository and should be rotated.

With the context starting, five parked test classes come back with no changes
beyond uncommenting. 1 failing test becomes 9 passing ones.

Six classes stay commented out and the README now says which and why, rather
than the previous "the test suite is disabled". They compile and run; 7
assertions drift from what the endpoints return today, and deciding the new
expected values is a separate job from getting the build green.

Adds MIT.
Committed from Windows without the executable bit, so ./mvnw is a permission
error on any Linux or macOS clone, CI included.
@qualv13
qualv13 merged commit 904be7e into master Aug 23, 2026
1 check passed
@qualv13
qualv13 deleted the chore/ci branch August 23, 2026 10:37
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.

1 participant