Skip to content

Replace legacy E2E coverage with an owner-only CLI contract suite#127

Merged
robzolkos merged 8 commits intomasterfrom
feature/e2e-role-tests
Apr 13, 2026
Merged

Replace legacy E2E coverage with an owner-only CLI contract suite#127
robzolkos merged 8 commits intomasterfrom
feature/e2e-role-tests

Conversation

@robzolkos
Copy link
Copy Markdown
Collaborator

@robzolkos robzolkos commented Apr 13, 2026

Summary

This PR replaces the older resource-by-resource E2E suite with a single owner-only CLI contract suite focused on the main question we care about now: does the CLI work end to end against a real account?

The previous setup mixed a lot of deeper command-specific integration coverage with an E2E entrypoint that was harder to run and maintain. This change makes the E2E story simpler, easier to remember, and more aligned with real CLI confidence: syntax, output contracts, CRUD flows, auth smoke, uploads, attachments, exports, avatars, and other high-value owner workflows.

What changed

  • replace e2e/tests with e2e/cli_tests as the only E2E suite
  • organize coverage around CLI contracts and workflow buckets instead of the previous legacy structure
  • add a shared owner-only fixture for board/card/comment/step setup across the suite
  • keep the suite focused on a single token/account model using:
    • FIZZY_TEST_TOKEN
    • FIZZY_TEST_ACCOUNT
  • add coverage for:
    • board, card, column, comment, step, reaction, notification, tag, pin, search
    • upload and attachment round trips, including downloads
    • output and syntax contracts
    • account export create/show
    • user avatar update/remove
    • webhook CRUD
    • config, doctor, commands, and version smoke coverage
  • add fixture inspection controls for local debugging:
    • FIZZY_E2E_KEEP_FIXTURE=1
    • FIZZY_E2E_TEARDOWN_DELAY=<seconds>
  • make make e2e the primary way to run E2E locally
  • update README and local test env template to match the new E2E workflow

Result

The repo now has one clear E2E path with a simpler mental model and stronger coverage of the CLI behavior we actually want to trust before shipping.


Summary by cubic

Replaced the legacy per-resource E2E suite with a single owner-only CLI contract suite that runs against a real account. Fixes fixture teardown isolation, improves teardown error formatting, and adds strict --quiet output contract checks.

  • Refactors

    • Replaced e2e/tests with e2e/cli_tests, organized by CLI contracts and workflows.
    • Added a shared owner-only fixture created once per run with HOME isolation; fixed teardown isolation.
    • Expanded coverage: CRUD flows; search; uploads/attachments (with downloads); webhooks; account settings/exports/avatars; output and syntax contracts with strict --quiet checks; config/doctor/version; auth failure paths.
    • Added readback checks after mutations via follow-up show/list calls.
    • Hardened harness and tooling: skips when required env vars are missing; auto-builds CLI if not found; .env.test.example; .gitignore ignores .env.test; Makefile loads .env.test, refuses tracked secrets, and supports FIZZY_TEST_BINARY; environment overrides are applied cleanly in the runner; global args omit --token when unset to enable missing-token tests.
    • Improved teardown error formatting for clearer failures.
  • Migration

    • Run with make e2e; run one test with make e2e-run NAME=TestBoardList.
    • Required: FIZZY_TEST_TOKEN, FIZZY_TEST_ACCOUNT; optional: FIZZY_TEST_API_URL, FIZZY_TEST_BINARY.
    • Debug: FIZZY_E2E_KEEP_FIXTURE=1 and FIZZY_E2E_TEARDOWN_DELAY=<seconds>.

Written for commit 86c9ca5. Summary will update on new commits.

Copilot AI review requested due to automatic review settings April 13, 2026 15:22
@github-actions github-actions bot added the enhancement New feature or request label Apr 13, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 35 files

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR replaces the legacy resource-by-resource E2E suite with a single owner-only CLI contract E2E suite, centered on validating end-to-end CLI behavior against a real account.

Changes:

  • Removed the legacy e2e/tests suite and introduced e2e/cli_tests with contract-style coverage (output/syntax + key workflows).
  • Added a shared owner-only fixture to set up common resources once per run, plus local debugging controls for fixture inspection.
  • Updated Makefile, README, and environment templates to make make e2e the primary workflow.

Reviewed changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
e2e/tests/user_test.go Removed legacy user E2E tests in favor of the new CLI contract suite.
e2e/tests/upload_test.go Removed legacy upload E2E tests; coverage moved to the new contract suite.
e2e/tests/tag_test.go Removed legacy tag list E2E test; covered by CLI contract suite.
e2e/tests/step_test.go Removed legacy step CRUD E2E tests; replaced by contract tests.
e2e/tests/reaction_test.go Removed legacy reaction E2E tests; replaced by contract tests.
e2e/tests/pin_test.go Removed legacy pin E2E tests; replaced by contract tests.
e2e/tests/notification_test.go Removed legacy notification E2E tests; replaced by contract tests.
e2e/tests/markdown_sanitization_test.go Removed legacy markdown sanitization E2E tests; suite is now focused on CLI contracts.
e2e/tests/main_test.go Removed legacy E2E TestMain; new suite provides its own TestMain flow.
e2e/tests/identity_test.go Removed legacy identity E2E tests; replaced by auth/identity coverage in cli_tests.
e2e/tests/error_test.go Removed legacy error-format E2E tests; new suite asserts exit codes/contracts.
e2e/tests/comment_test.go Removed legacy comment E2E tests; replaced by contract tests.
e2e/tests/comment_attachment_test.go Removed legacy comment attachment E2E tests; replaced by round-trip contract tests.
e2e/tests/column_test.go Removed legacy column E2E tests; replaced by contract CRUD + syntax tests.
e2e/tests/card_test.go Removed legacy card E2E tests; replaced by contract CRUD/workflow tests.
e2e/tests/board_test.go Removed legacy board E2E tests; replaced by contract CRUD/workflow tests.
e2e/tests/auth_test.go Removed legacy auth E2E tests; replaced by auth contract tests.
e2e/tests/attachment_test.go Removed legacy attachment E2E tests; replaced by upload/attachment round-trip tests.
e2e/harness/harness.go Added helper to report missing required env vars for the new suite.
e2e/harness/fixture.go Added shared fixture setup/teardown for owner-only CLI contract runs.
e2e/cli_tests/webhook_test.go Added webhook CRUD contract coverage.
e2e/cli_tests/utility_commands_test.go Added config/doctor/commands/version contract coverage.
e2e/cli_tests/upload_attachment_test.go Added upload + card/comment attachment round-trip coverage with downloads.
e2e/cli_tests/syntax_contract_test.go Added syntax/usage contract assertions for CLI commands and flags.
e2e/cli_tests/search_and_auth_test.go Added search + negative auth contract coverage.
e2e/cli_tests/output_contract_test.go Added output contract coverage across common flags (--quiet, --jq, etc.).
e2e/cli_tests/main_test.go New TestMain to build binary (if needed), create shared fixture, and control teardown/inspection.
e2e/cli_tests/helpers_test.go Added shared helpers (resource creation, ID extraction, avatar checks, etc.).
e2e/cli_tests/crud_subresources_test.go Added contract-level CRUD coverage for subresources (columns/comments/steps/reactions/notifications).
e2e/cli_tests/crud_card_test.go Added card workflow and CRUD coverage (assign/pin/tag/image/attachments/move, etc.).
e2e/cli_tests/crud_board_test.go Added board CRUD and workflow coverage (publish/unpublish, views, entropy, involvement).
e2e/cli_tests/account_user_test.go Added account and user contract coverage including avatar update/remove.
README.md Updated local testing docs to use make e2e and documented required env vars and fixture inspection modes.
Makefile Replaced test-e2e behavior with e2e target, added per-file/run helpers, and optional .env.test loading.
.env.test.example Added template for local E2E credentials.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/cli_tests/search_and_auth_test.go Outdated
Comment thread e2e/cli_tests/search_and_auth_test.go Outdated
Comment thread Makefile Outdated
Comment thread e2e/cli_tests/helpers_test.go Outdated
Comment thread e2e/harness/fixture.go Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 15:49
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — addressed the review feedback: auth tests now use ExitAuthFailure, .env.test is gitignored and refused if tracked, avatar redirect checks accept any 3xx, and fixture configHome is only removed after successful teardown.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/harness/fixture.go
Comment thread e2e/cli_tests/crud_subresources_test.go Outdated
Comment thread e2e/cli_tests/output_contract_test.go Outdated
Comment thread Makefile Outdated
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — addressed the follow-up review feedback: fixture setup now does best-effort remote cleanup on setup failure, reaction CRUD discovers created reaction IDs via list readback instead of assuming create returns one, output contract tests detect JSON envelopes by decoding JSON instead of checking a prefix, and Make now respects a caller-provided FIZZY_TEST_BINARY override.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="e2e/harness/fixture.go">

<violation number="1" location="e2e/harness/fixture.go:45">
P2: Teardown can return before removing the temp config directory, so a setup failure followed by a delete error will leak the temp HOME. Consider ensuring tmpDir cleanup still happens when Teardown fails.</violation>
</file>

<file name="e2e/cli_tests/crud_subresources_test.go">

<violation number="1" location="e2e/cli_tests/crud_subresources_test.go:118">
P2: Using `listAddedID` to identify the created reaction is nondeterministic and can delete the wrong reaction when more than one new item appears between list snapshots.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread e2e/harness/fixture.go
Comment thread e2e/cli_tests/crud_subresources_test.go Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 16:09
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — addressed the two issues identified by cubic: fixture setup failure cleanup now removes the temp HOME even if remote teardown also fails, and reaction CRUD now identifies newly created reactions by matching the added item for the current user and expected content instead of using a nondeterministic first-added diff.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e/harness/fixture.go
Comment thread e2e/harness/fixture.go
Comment thread e2e/cli_tests/output_contract_test.go Outdated
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — addressed the latest review feedback: fixture teardown now always attempts temp-home cleanup and aggregates teardown errors, fixture runs now isolate XDG config/data/state paths under the temp fixture home, and the markdown/styled output contract checks now fail on any valid JSON output instead of only envelope-shaped objects.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="e2e/harness/fixture.go">

<violation number="1" location="e2e/harness/fixture.go:70">
P2: Use a literal format string when returning the joined teardown error; passing dynamic text directly to `fmt.Errorf` can mangle `%` characters in stderr.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread e2e/harness/fixture.go Outdated
Copilot AI review requested due to automatic review settings April 13, 2026 16:22
@robzolkos
Copy link
Copy Markdown
Collaborator Author

Fixed — addressed the latest issue identified by cubic: fixture teardown now wraps the joined error text with a literal format string so percent signs in stderr cannot be interpreted by fmt.Errorf.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 36 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile
Comment thread e2e/cli_tests/main_test.go
Comment thread e2e/cli_tests/search_and_auth_test.go
Comment thread e2e/cli_tests/helpers_test.go
@robzolkos robzolkos merged commit a439e56 into master Apr 13, 2026
20 checks passed
@robzolkos robzolkos deleted the feature/e2e-role-tests branch April 13, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants