add rollback tests and update test descriptions #3

Merged
maxp merged 5 commits from test/fail-write-and-rollback into main 2025-05-30 11:21:41 +02:00
Owner
  • Add tests for rollback behavior in writeUnitFiles on errors
  • Simulate file write and delete failures in test scenarios
  • Log rollback failures when file deletion is not possible
  • Update all test descriptions and comments to English
  • Add testing/mock.ts dependency in deno.lock

This change adds comprehensive tests for the writeUnitFiles function to verify that files are properly rolled back if errors occur during their creation. The tests simulate failures when writing .service or .timer files, as well as when file deletion is blocked, and check that the function responds by cleaning up as expected or logging rollback failures. All test comments and descriptions have been updated to English for clarity. The testing/mock.ts dependency was added to enable function stubbing in tests.

#2

- Add tests for rollback behavior in `writeUnitFiles` on errors - Simulate file write and delete failures in test scenarios - Log rollback failures when file deletion is not possible - Update all test descriptions and comments to English - Add `testing/mock.ts` dependency in `deno.lock` This change adds comprehensive tests for the `writeUnitFiles` function to verify that files are properly rolled back if errors occur during their creation. The tests simulate failures when writing `.service` or `.timer` files, as well as when file deletion is blocked, and check that the function responds by cleaning up as expected or logging rollback failures. All test comments and descriptions have been updated to English for clarity. The `testing/mock.ts` dependency was added to enable function stubbing in tests. #2
maxp added 4 commits 2025-05-30 11:18:45 +02:00
- Add tests to verify rollback behavior when file writing fails
- Simulate various error scenarios to ensure proper cleanup
- Log rollback failures when file deletion is prohibited
- Translate all test descriptions and inline comments from German to English
chore(deps): update deno.lock with new dependency
All checks were successful
Auto Changelog & Release / detect-version-change (push) Successful in 3s
Auto Changelog & Release / release (push) Has been skipped
Auto Changelog & Release / changelog-only (push) Successful in 7s
149a0c2b39
- Adds a new dependency to deno.lock for testing utilities
chore(changelog): update unreleased changelog
All checks were successful
CI / build (pull_request) Successful in 7s
2882cc33aa
maxp added this to the Testabdeckung erhöhen project 2025-05-30 11:18:46 +02:00
maxp force-pushed test/fail-write-and-rollback from 2882cc33aa to e5f9f2c45a 2025-05-30 11:21:12 +02:00 Compare
gitea-actionsbot added 1 commit 2025-05-30 11:21:21 +02:00
maxp merged commit f4c7b2e18f into main 2025-05-30 11:21:41 +02:00
maxp deleted branch test/fail-write-and-rollback 2025-05-30 11:21:41 +02:00
maxp moved this to Done in Testabdeckung erhöhen on 2025-05-30 20:07:12 +02:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: maxp/systemd-timer#3
No description provided.