Skip to content

test(build): add comprehensive test coverage for build.clj refactor#2

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775755570-build-test-coverage
Open

test(build): add comprehensive test coverage for build.clj refactor#2
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1775755570-build-test-coverage

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot commented Apr 9, 2026

Summary

Adds 26 tests (66 assertions) covering all functions in build.clj, which previously had zero test coverage. This was motivated by the recent refactor(build): streamline release workflow commit which made several structural changes:

  • Replaced global version/jar-file/pom-file defs with per-call helpers (required-version, jar-file-path, pom-file-path)
  • Changed jar/install/deploy signatures from [_] to [opts] with required :version
  • Added resolved-clojars-repository helper
  • Changed indentation inside the pom-data [:scm ...] vector

What's tested:

  • Static defs (lib, class-dir, scm-url, basis)
  • pom-data structure, including that SCM children (:connection, :developerConnection, :tag) are still nested inside [:scm ...] after the indentation change
  • All private helpers: required-version, jar-file-path, pom-file-path, resolved-clojars-repository
  • Public functions clean, jar, install, deploy — orchestration order, argument threading, and error cases
  • Behavioral equivalence: path helpers produce the same format as the old global defs

Infrastructure: Adds a :test-build alias in deps.edn, a test-build bb task, and a test_build_runner.clj — mirroring the existing test-db pattern. Build tests are kept separate from bb test / bb verify because they require the :build dependencies.

Review & Testing Checklist for Human

  • Verify pom-data SCM nesting in build.clj — The refactor changed indentation on lines 19–22 of build.clj making :connection/:developerConnection/:tag look like they might be siblings of [:scm ...] rather than children. Bracket counting says they're still nested correctly, but visually it's misleading. The pom-data-scm-nesting-is-correct test locks this in — confirm the test matches your intent.
  • Check "." in :test-build extra-paths — The project root is added to the classpath so build.clj is loadable. This is scoped only to the :test-build alias and mirrors how -T:build works, but verify you're comfortable with it.
  • Confirm build tests should stay out of bb verify — Build tests are in a separate runner (like test-db), so bb test and bb verify do NOT run them. If you want them included in CI / verify, the wiring needs adjustment.
  • Run bb test-build locally to confirm the new alias and task work end-to-end.

Notes

  • All 76 existing tests still pass (bb test → 0 failures, 0 errors).
  • Lint (bb lint) and format check (bb format-check) both pass cleanly.
  • The pom-data-scm-tag-defaults-to-HEAD test conditionally skips its "HEAD" assertion when GITHUB_REF_NAME is set in the environment (e.g. in CI).
  • All build API calls (b/delete, b/copy-dir, b/write-pom, b/jar, dd/deploy) are mocked via with-redefs — tests verify wiring and argument threading, not that a real jar is produced.
  • Rebased onto latest main to resolve conflicts (no code changes from the rebase).

Link to Devin session: https://app.devin.ai/sessions/0c6fb5edb4924d3fa4db87fef3075ccb
Requested by: @hatappo

@devin-ai-integration
Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@hatappo hatappo force-pushed the main branch 2 times, most recently from 1182d98 to 3ab939e Compare April 9, 2026 18:15
- Add 26 tests (66 assertions) covering all build.clj functions:
  required-version, jar-file-path, pom-file-path, resolved-clojars-repository,
  clean, jar, install, deploy, and pom-data structure validation
- Verify pom-data SCM nesting is correct after indentation change
- Verify behavioral equivalence of jar-file-path/pom-file-path with old globals
- Add :test-build alias in deps.edn and test-build task in bb.edn
- Add test_build_runner.clj mirroring existing test-db-runner pattern
@devin-ai-integration devin-ai-integration bot force-pushed the devin/1775755570-build-test-coverage branch from d4862df to 45233d6 Compare April 9, 2026 18:17
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