-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Generate metrics documentation #65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d5b8a67
to
7c427d1
Compare
…terprise_mode` pytest markers
|
||
Counter. | ||
|
||
Total number of tests run by pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing period.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6c14406
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple nits but ✅able material already.
def __call__(self, name: str = "") -> "Snapshot": ... | ||
|
||
|
||
class Snapshot: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 83a0e21.
|
||
|
||
@pytest.fixture | ||
def snapshot(request: pytest.FixtureRequest) -> SnapshotFixture: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docstring please!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 83a0e21.
This PR adds the
flagsmith docgen metrics
command. The output is valid Markdown describing all Prometheus metrics exported by the application.Besides that, several improvements and fixes are introduced:
prometheus_multiproc_dir
is only used with tests where it's needed (currently just the one that tests the/metrics
endpoint).snapshot
fixture added totest_tools
to enable snapshot testing. Snapshots are a convenient way to implement tests where outputs are asserted against reference values.pytest --snapshot-update
option refreshes the snapshots automatically for the tests being run, and xfails the affected tests.clear_lru_caches
fixture is tuned to expect dirty caches before the test starts.