11
31
Fork
You've already forked silverfish
19

improved testing utilities for controllers #195

Merged
zkat merged 1 commit from zkat/more-test-utils into main 2026年01月05日 00:21:18 +01:00
Owner
Copy link

This adds a MockApp and starts encapsulating common
controller test behavior to make it significantly
easier to write tests in various scenarios, such
as when needing to be authenticated.

Fixes: #193

This adds a MockApp and starts encapsulating common controller test behavior to make it significantly easier to write tests in various scenarios, such as when needing to be authenticated. Fixes: https://codeberg.org/conjured/silverfish/issues/193
zkat force-pushed zkat/more-test-utils from 9c1c76ef3c
Some checks failed
CI Silverfish / silverfish-amd64 (pull_request) Waiting to run
aarch64 checks / silverfish--aarch64 (pull_request) Has been cancelled
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Has been cancelled
to fc8e6ebbf7
Some checks failed
CI Silverfish / silverfish-amd64 (pull_request) Waiting to run
aarch64 checks / silverfish--aarch64 (pull_request) Has been cancelled
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Has been cancelled
2026年01月04日 23:23:04 +01:00
Compare
zkat force-pushed zkat/more-test-utils from fc8e6ebbf7
Some checks failed
CI Silverfish / silverfish-amd64 (pull_request) Waiting to run
aarch64 checks / silverfish--aarch64 (pull_request) Has been cancelled
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Has been cancelled
to 983e119311
Some checks failed
CI Silverfish / silverfish-amd64 (pull_request) Waiting to run
aarch64 checks / silverfish--aarch64 (pull_request) Has been cancelled
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Has been cancelled
2026年01月04日 23:23:49 +01:00
Compare
zkat force-pushed zkat/more-test-utils from 983e119311
Some checks failed
CI Silverfish / silverfish-amd64 (pull_request) Waiting to run
aarch64 checks / silverfish--aarch64 (pull_request) Has been cancelled
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Has been cancelled
to 90cc7ae0c6
All checks were successful
aarch64 checks / silverfish--aarch64 (pull_request) Successful in 12m54s
CI Silverfish musl / silverfish--musl-x86_64 (pull_request) Successful in 15m36s
CI Silverfish / silverfish-amd64 (pull_request) Successful in 11m41s
2026年01月04日 23:28:02 +01:00
Compare
kylewlacy left a comment
Copy link

Awesome, the new utils look great!

Awesome, the new utils look great!
@ -31,0 +58,4 @@
TraceLayer::new_for_http()
.make_span_with(DefaultMakeSpan::new().include_headers(true))
.on_request(DefaultOnRequest::new().level(Level::WARN))
.on_response(DefaultOnResponse::new().level(Level::WARN)),
Contributor
Copy link

#nonblocking why WARN-level events?

#nonblocking why `WARN`-level events?
Author
Owner
Copy link

This was me trying to figure out how to get tracing to output anything and failing. I made an issue for it but I figure having this here will help

This was me trying to figure out how to get tracing to output anything and failing. I made an issue for it but I figure having this here will help
zkat deleted branch zkat/more-test-utils 2026年01月05日 00:21:18 +01:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat
Breaking
Breaking change that won't be backward compatible
Flag/Good First Issue
Good issue for first-time contributors
Kind/Accessibility
Accessibility issue, bug or otherwise
Kind/Appearance
Design, styling, and other aesthetic and visual items
Kind/Bug
Something is not working
Kind/Compliance
Legal, policy, or some other kind of compliance
Kind/DevOps
CI/CD, releases, etc
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Performance
Gotta go fast
Kind/Security
This is security issue
Kind/Technical Improvement
Underlying technical improvement that is not necessarily user-impacting or visible.
Kind/Testing
Issue or pull request related to testing
Kind/UX
Related to user experience/product
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Size
L
Significant change
Size
M
Medium-size change
Size
S
Small change
Size
XL
Very large change that might take months to complete and impact many components
Size
XS
Trivially small change
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Status
Needs Design
Requires design/review from Alchemists (product/UX)
Status
Needs Discussion
A discussion needs to happen before implementation
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
conjured/silverfish!195
Reference in a new issue
conjured/silverfish
No description provided.
Delete branch "zkat/more-test-utils"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?