Include healthcheck status in Docker container inspect() result#8
Conversation
Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Do not mock docker for tests |
I have updated the test to use |
Refactor test to spy on DockerApi.prototype.exec instead of mocking the entire module, ensuring better coverage of internal logic while simulating CLI output. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
|
Don't use mocks at all. Direct test using docker |
I have removed all mocks and rewritten the test to use real Docker containers with the |
Replace mocked tests with real Docker container tests using busybox, handling environment limitations like rate limits gracefully. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
|
Add a method to the docker Container interface that waits for the healthy status |
I have added a |
Add waitForHealth method to Container resource to allow waiting for healthy status, and update tests to use it. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
|
hoist waitForHealth and inspect so we don't have to declare them twice |
I have refactored the code to hoist the |
Hoist inspect and waitForHealth methods in Container resource implementation to avoid code duplication across execution branches. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
|
Return a |
I have updated |
Update waitForHealth to return ContainerRuntimeInfo on success, providing immediate access to container details. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com>
* feat: include healthcheck status in Docker container inspect() result Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * test(docker): use spyOn exec instead of mocking DockerApi module Refactor test to spy on DockerApi.prototype.exec instead of mocking the entire module, ensuring better coverage of internal logic while simulating CLI output. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * test(docker): switch to real docker tests with safe failure mode Replace mocked tests with real Docker container tests using busybox, handling environment limitations like rate limits gracefully. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * feat(docker): add waitForHealth method to Container resource Add waitForHealth method to Container resource to allow waiting for healthy status, and update tests to use it. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * refactor(docker): hoist container methods to avoid duplication Hoist inspect and waitForHealth methods in Container resource implementation to avoid code duplication across execution branches. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * feat(docker): update waitForHealth to return runtime info Update waitForHealth to return ContainerRuntimeInfo on success, providing immediate access to container details. Co-authored-by: aleclarson <1925840+aleclarson@users.noreply.github.com> * chore: prevent API drift * chore: revert name change * chore: revert tsconfig change --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Updated
Docker containerresource to include healthcheck status in itsinspect()result.ContainerInfotype inalchemy/src/docker/api.tsto includeHealthobject inState.ContainerRuntimeInfotype inalchemy/src/docker/api.tsto includehealthproperty.toRuntimeInfoinalchemy/src/docker/container.tsto extracthealthstatus.alchemy/test/docker/container-health.test.ts.PR created automatically by Jules for task 8868311562361659815 started by @aleclarson