Skip to content

Add automated testing harness (closes #10) - #11

Merged
OliverRC merged 1 commit into
mainfrom
sandcastle/sequential-reviewer/1783970456493
Jul 13, 2026
Merged

Add automated testing harness (closes #10)#11
OliverRC merged 1 commit into
mainfrom
sandcastle/sequential-reviewer/1783970456493

Conversation

@OliverRC

Copy link
Copy Markdown
Owner

Task

Closes #10 — a full automated testing harness so kickflip's behaviour is no longer hand-tested.

What was done

Added unit and integration tests covering the tool's behaviour:

  • Different modes — Tags, GitHubMergePR and Folder are all exercised, at both the service level (GitServiceTests, FileSystemServiceTests) and end-to-end through the CLI (CliIntegrationTests).
  • Dry run makes no changesSftpDeploymentServiceTests verify a dry run does not connect and does not touch local files; CliIntegrationTests verify the CLI reports planned changes and never connects during a dry run.
  • Different commandsdeploy and github pull-request command wiring, help output and argument validation are covered.

Key decisions

  • Git-based tests build real temporary git repositories (GitRepositoryBuilder) rather than mocking LibGit2Sharp, so find modes are proven end-to-end.
  • Integration tests drive the compiled CLI as an external process (CliRunner), covering argument parsing and handler wiring.
  • Live SFTP/FTP servers cannot be stood up in unit tests, so remote-deployment coverage focuses on the safety-critical dry-run path.

Files changed

  • src/kickflip.Tests/TestHelpers/{TempDirectory,GitRepositoryBuilder,CliRunner}.cs
  • src/kickflip.Tests/{Utilities,IgnoreService,FileSystemService,GitService,OutputService,SftpDeploymentService,CliIntegration}Tests.cs
  • README.md (Testing section)

46 tests pass via dotnet test.

Blockers for next iteration

  • The CI token lacks workflow scope, so I could not add a dotnet test step to .github/workflows/main.yml. A maintainer should add that step.
  • Live SFTP/FTP end-to-end testing would need a containerised server; deferred.

Add unit and integration tests covering the tool's behaviour.

Key decisions:
- Unit tests exercise services directly; git tests build real temp
  repositories (GitRepositoryBuilder) so find modes are proven end-to-end.
- Integration tests (CliIntegrationTests) drive the compiled CLI as an
  external process to verify command wiring, argument validation, all
  deployment modes (Tags, GitHubMergePR, Folder) and that dry run reports
  planned changes without connecting to the remote server.
- SFTP live deployment cannot be stood up in tests, so coverage focuses on
  the safety-critical dry-run path (no connect, no local file changes).

Files changed:
- src/kickflip.Tests/TestHelpers/{TempDirectory,GitRepositoryBuilder,CliRunner}.cs
- src/kickflip.Tests/{Utilities,IgnoreService,FileSystemService,GitService,OutputService,SftpDeploymentService,CliIntegration}Tests.cs
- README.md (Testing section)

Blockers for next iteration: the CI token lacks 'workflow' scope so I could
not add a 'dotnet test' step to .github/workflows/main.yml. A maintainer
should add that step. Live SFTP/FTP end-to-end testing would need a
containerised server; deferred as dry-run covers the safety path.
@OliverRC OliverRC mentioned this pull request Jul 13, 2026
@OliverRC

Copy link
Copy Markdown
Owner Author

Review refinements applied:

  • Consolidated repeated CLI integration assertions into small helper methods for clarity and reduced duplication.
  • Centralised dummy SFTP/CLI credential constants in a shared helper (single source of truth).
  • Improved readability by extracting assembly path resolution and using null-checking.
  • Made unit tests a bit more explicit by naming services (, ) and avoiding repeated nesting.
  • Added and helpers to make ignore-related tests more intention-revealing.
  • Minor consistency tweaks ( instead of , clearer local variable names).

All tests still pass ( Determining projects to restore...
All projects are up-to-date for restore.
kickflip -> /home/agent/workspace/src/kickflip/bin/Debug/net8.0/kickflip.dll
kickflip.Tests -> /home/agent/workspace/src/kickflip.Tests/bin/Debug/net8.0/kickflip.Tests.dll
Test run for /home/agent/workspace/src/kickflip.Tests/bin/Debug/net8.0/kickflip.Tests.dll (.NETCoreApp,Version=v8.0)
VSTest version 17.11.1 (arm64)

Starting test execution, please wait...
A total of 1 test files matched the specified pattern.

Passed! - Failed: 0, Passed: 46, Skipped: 0, Total: 46, Duration: 325 ms - kickflip.Tests.dll (net8.0)).

@OliverRC

Copy link
Copy Markdown
Owner Author

Follow-up: I noticed package-lock.json was untracked in the working tree; I committed it to keep the branch consistent.

@OliverRC
OliverRC merged commit 1684cc7 into main Jul 13, 2026
1 check passed
@OliverRC
OliverRC deleted the sandcastle/sequential-reviewer/1783970456493 branch July 13, 2026 19:46
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.

Full Testing harness

1 participant