Skip to content

chore(ci): isolate Docker-dependent acceptance tests - #7007

Open
parker-snyk wants to merge 4 commits into
mainfrom
IDP-6-circleci-docker-test-split
Open

chore(ci): isolate Docker-dependent acceptance tests#7007
parker-snyk wants to merge 4 commits into
mainfrom
IDP-6-circleci-docker-test-split

Conversation

@parker-snyk

@parker-snyk parker-snyk commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Measured impact

A successful before-and-after comparison reduced both CircleCI usage and PR validation time:

Before After Savings
CircleCI credits 64,023 60,510 3,513 credits (5.5%)
Workflow duration 53m10s 47m13s 5m57s (11.2%)

Comparison runs:

What changed

The acceptance workflow previously started Remote Docker for every Docker and Alpine shard, creating 36 Remote Docker environments per PR. Only two container tests use the Docker daemon.

This change moves those two tests into one dedicated Remote Docker job. The other 134 acceptance specs keep their existing platform coverage without starting Remote Docker. It also removes the unused Docker package from the Alpine test setup.

Tracking ticket: IDP-6

Validation

  • make format
  • make lint
  • make build
  • CircleCI pipeline 38482 passed, including the dedicated Docker daemon job

Run Docker daemon coverage in one dedicated Linux acceptance job instead of provisioning Remote Docker for every Docker and Alpine shard.

Keep the remaining acceptance matrix free of Docker daemon commands and remove the unused Docker package from Alpine setup.
Install and verify a pinned Docker Compose plugin in the dedicated daemon job, then invoke proxy fixtures through the supported docker compose command.

This makes the relocated proxy-authentication tests execute instead of failing because the build image lacks the legacy docker-compose binary.
Copy the proxy setup scripts into the fixture image instead of bind-mounting a path that is unavailable on CircleCI's remote Docker VM.

Copy the generated Kerberos credentials back into the test workspace with docker cp so the CLI can still consume them.
Keep proxy-authentication coverage in its existing conditional suite because CircleCI Remote Docker does not provide the two-way networking that fixture requires.

Remove the Compose and fixture changes so the dedicated Remote Docker job runs only the container daemon tests targeted by this optimization.
@snyk-io

snyk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown
Contributor
Warnings
⚠️ There are multiple commits on your branch, please squash them locally before merging!

Generated by 🚫 dangerJS against 21ff559

@parker-snyk
parker-snyk marked this pull request as ready for review July 16, 2026 18:21
@parker-snyk
parker-snyk requested a review from a team as a code owner July 16, 2026 18:21
@snyk-pr-review-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Reduced Platform Coverage 🟡 [minor]

The Docker-dependent acceptance tests were previously executed across multiple platforms (Windows, Linux Arm64, Alpine). This PR isolates them to a single linux/amd64 job. While this saves significant CI credits, it removes validation for architecture-specific behaviors (e.g., Docker socket handling or image analysis on Arm64) that the CLI might encounter in production on those platforms. Per AGENTS.md, acceptance tests are expected to cover multiple OS/arch combinations.

find test/jest/acceptance ts-binary-wrapper/test/acceptance -name '*.spec.ts' ! -name '*.docker.spec.ts' \
  | circleci tests run \
      --command="xargs npx jest --maxWorkers=1 --selectProjects coreCli --reporters=jest-junit --reporters=default --forceExit --" \
      --split-by=timings \
      --timings-type=file
Removed Remote Docker Support 🟡 [minor]

The setup_remote_docker command was previously active for all alpine.* executors. This PR removes that automatic activation, meaning any tests remaining in the Alpine shard that might implicitly rely on Docker environment detection or sidecar services will now fail. This is paired with the removal of the docker CLI package in install-deps-alpine-full.

- when:
    condition: << parameters.remote_docker >>
    steps:
      - setup_remote_docker:
          docker_layer_caching: false
📚 Repository Context Analyzed

This review considered 6 relevant code sections from 5 files (average relevance: 1.00)

🤖 Repository instructions applied (from AGENTS.md)


jest.setTimeout(1000 * 300);

describe('snyk container with a local Docker daemon', () => {

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.

This may lead to problems when executing the tests directly with jest (locally)

before

  • windows safe guard (container.spec.ts:132)
    • describeIf(!isWindows)('test', () => {
  • macos safe guard (lines 348, 408)
    • if (os.platform() === 'darwin') {
        return;
      }
      

after

  • tests were moved under this line describe('snyk container with a local Docker daemon', () => {
    • no safeguards for windows nor macos (apparently, please correct me if I am wrong)

Could you please address or elaborate on this (apparent) issue?

Thanks, good job


const execAsync = promisify(exec);

jest.setTimeout(1000 * 300);

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.

should each it have a timeout as well to be set?

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.

yes, maybe more granular will be better

Comment thread .circleci/config.yml
Comment on lines +908 to +909
requires:
- build linux amd64

@danskmt danskmt Jul 17, 2026

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.

should these tests consider only Linux?
I wonder if we should consider Windows as well. I see that before they were being ignored on MacOS.

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.

docker tests are currently running just for linux if I am not mistaken

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.

3 participants