Skip to content

Add offline end-to-end tests for watchdogDownloader #3

Description

@Whning0513

Problem

The current CI checks wdd with bash -n and --version, but it does not exercise project initialization, resumed HTTP downloads, watchdog state, or manifest verification. Regressions in those paths could pass CI.

Goal

Add deterministic, offline end-to-end coverage for watchdogDownloader/wdd on Linux. The test must use temporary directories and a local HTTP server; it must not depend on a public download URL.

Acceptance criteria

  • Start a local test server that serves a deterministic binary fixture and supports byte-range requests.
  • Generate a TSV manifest with exact byte size and SHA-256 values.
  • Exercise wdd init and a foreground download path in a temporary project.
  • Pre-create a partial output and verify that the next request resumes it rather than replacing valid bytes.
  • Verify that wdd verify succeeds for the completed fixture and returns non-zero for a truncated or corrupted fixture.
  • Clean up the HTTP server, downloader processes, locks, and temporary files even when an assertion fails.
  • Run without external network access and avoid long fixed sleeps.
  • Add the test to .github/workflows/ci.yml.

A plain Bash test is sufficient; a testing framework is optional. Keep production defaults and manifest compatibility unchanged unless the test exposes a real bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions