Skip to content

Adapt dtcw bats test suite to the v4 environment model (un-skip the v3 tests) #43

Description

@raifdmueller

Context

PR #41 skipped 25 tests across 7 bats files because the v4 dtcw wrapper changed the environment model and the tests still encode v3 behaviour. This issue tracks adapting the dtcw bats suite to the v4 model and un-skipping them.

Root cause (v4 behaviour changes)

  1. local is a first-class environment — always detected and preferred. So the env list now reads local … (not none / sdk / docker), and Using environment: local.
  2. Direct script invocation — v4 no longer forwards to an sdk-/docker-installed docToolchain, so the mock_doctoolchain / mock_docker call counts are 0.
  3. ./dtcw tasks succeeds where v3 exited non-zero (nothing installed → now local runs).
  4. Local install ships its own JDK — the system-Java version gate (assert_java_version_supported, dtcw:514) is bypassed, so unsupported-Java scenarios no longer error. ⟶ overlaps with v4: make the supported/installed Java version configurable (currently hard-pinned to 17) #42.
  5. docker environment not pulled in yet for v4.

Skipped tests to revisit

File Tests Category
docker_environment.bats forward call to docker env list / forwarding
install_doctoolchain.bats show java missing · system with supported Java · missing component · unknown component env list nonelocal
install_java.bats install java (linux/x64) before doctoolchain installed env list nonelocal
java_environment.bats use JAVA_HOME · invalid JAVA_HOME · supported Java 17 · unsupported Java 11 · unsupported Java 8 · unsupported Java 20 · local Java before system Java Java gate bypassed by local JDK (see #42)
local_environment.bats tasks - forward to local doctoolchain · overrule config with DTC_CONFIG_FILE direct invocation / mock not called
pristine_environment.bats no arguments shows usage · tasks uses local environment - shows install docToolchain · sdk tasks shows install SDKMAN! local-runs / usage output
sdk_installation.bats don't show how to install SDKMAN! · doctoolchain installed with sdk - java missing · tasks - forward to sdk doctoolchain · using local with sdk environment fails · using docker with sdk environment fails · installing docker has no side effects · using docker with sdk installation sdk-forwarding / local-first / docker

All are marked with a skip "v4: …" reason in the source, so they are greppable: grep -rn 'skip "v4' test/.

Acceptance criteria

  • Each skipped test is either rewritten to assert the intended v4 behaviour, or removed if the scenario no longer exists in v4.
  • The intended v4 environment precedence is decided and documented (local vs. explicitly-requested sdk/docker).
  • The Java-version gate behaviour under a bundled local JDK is defined (coordinate with v4: make the supported/installed Java version configurable (currently hard-pinned to 17) #42).
  • docker environment tests are re-enabled once v4 docker support lands.
  • grep -rn 'skip "v4' test/ returns nothing.
  • test/bats/bin/bats --filter-tags '!e2e' test is green without skips on ubuntu and macos.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    testv4docToolchain v4 architecture migration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions