test: add local docker compose coverage#1846
Open
abdul712 wants to merge 1 commit into
Open
Conversation
| export default defineConfig({ | ||
| test: { | ||
| environment: "node", | ||
| include: ["**/*.test.ts"], |
Contributor
There was a problem hiding this comment.
The
include pattern ["**/*.test.ts"] will recurse through all subdirectories. Since this package's tests live at the root level, scoping it to ["*.test.ts"] is both cleaner and avoids any accidental discovery of test files that end up in sub-directories (e.g., a future scripts/ folder).
Suggested change
| include: ["**/*.test.ts"], | |
| include: ["*.test.ts"], |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/local-docker/vitest.config.ts
Line: 6
Comment:
The `include` pattern `["**/*.test.ts"]` will recurse through all subdirectories. Since this package's tests live at the root level, scoping it to `["*.test.ts"]` is both cleaner and avoids any accidental discovery of test files that end up in sub-directories (e.g., a future `scripts/` folder).
```suggestion
include: ["*.test.ts"],
```
How can I resolve this? If you propose a fix, please make it concise.
Comment on lines
+34
to
+36
| describe("local Docker compose file", () => { | ||
| it("keeps the expected local development services wired", async () => { | ||
| const compose = await readCompose(); |
Contributor
There was a problem hiding this comment.
readCompose() is called independently inside each it block, which reads and parses the YAML file twice per test run. Hoisting the parse into a beforeAll and sharing the result removes the duplicate I/O and makes the shared setup intent explicit.
Suggested change
| describe("local Docker compose file", () => { | |
| it("keeps the expected local development services wired", async () => { | |
| const compose = await readCompose(); | |
| describe("local Docker compose file", () => { | |
| let compose: ComposeFile; | |
| beforeAll(async () => { | |
| compose = await readCompose(); | |
| }); | |
| it("keeps the expected local development services wired", () => { |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/local-docker/docker-compose.test.ts
Line: 34-36
Comment:
`readCompose()` is called independently inside each `it` block, which reads and parses the YAML file twice per test run. Hoisting the parse into a `beforeAll` and sharing the result removes the duplicate I/O and makes the shared setup intent explicit.
```suggestion
describe("local Docker compose file", () => {
let compose: ComposeFile;
beforeAll(async () => {
compose = await readCompose();
});
it("keeps the expected local development services wired", () => {
```
How can I resolve this? If you propose a fix, please make it concise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@cap/local-dockerso it participates in the root Turbo test pipelinedocker-compose.ymland verifies the expected local services plus named-volume consistencyminio-dataandminio-certsvolume declarations that were not used by any service, and fix the local S3 comment typoThis is a narrow, non-overlapping slice for #54; I did not touch the desktop/utils/sdk/env/database testing areas covered by active PRs.
/claim #54
AI-assisted with Codex; I reviewed the diff and kept payment details out of public comments.
Verification
corepack pnpm install --filter @cap/local-docker --frozen-lockfile --ignore-scriptscorepack pnpm --filter @cap/local-docker testcorepack pnpm turbo run test --filter=@cap/local-dockercorepack pnpm exec biome check packages/local-docker/package.json packages/local-docker/vitest.config.ts packages/local-docker/docker-compose.test.tsgit diff --checkGreptile Summary
This PR wires
@cap/local-dockerinto the Turbo test pipeline by adding a Vitest setup and a compose-file smoke test, and cleans up two unused named-volume declarations (minio-data,minio-certs) fromdocker-compose.yml.docker-compose.test.ts): parsesdocker-compose.ymlwith theyamlpackage and asserts expected service names, key image/build properties, and that every declared named volume is actually referenced by a service — the stale-volume removal is what makes the second assertion pass.minio-dataandminio-certsvolume declarations (never used;minioalready uses a bind-mount at~/minio/data) and fixes the "Strorage" typo in the comment.vitest ~2.1.9andyaml ^2.8.1as dev dependencies, consistent with versions used byapps/discord-botandapps/desktop, and locks them inpnpm-lock.yaml.Confidence Score: 4/5
Safe to merge; the compose cleanup and test addition are narrow and well-scoped with no risk to running services.
The changes are straightforward: two stale volume declarations are removed, a typo is fixed, and a new test correctly validates the resulting compose file. The test logic for named-volume consistency is sound. The only observations are style-level: readCompose() is called once per test rather than shared via beforeAll, and the include glob in vitest.config.ts is broader than needed for a flat package.
No files require special attention; docker-compose.test.ts and vitest.config.ts have minor style-level suggestions worth a quick look.
Important Files Changed
Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "test: add local docker compose coverage" | Re-trigger Greptile