Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

0.28 #245

Merged
merged 6 commits into from
Jan 16, 2023
Merged

0.28 #245

merged 6 commits into from
Jan 16, 2023

Conversation

peterschutt
Copy link
Member

@peterschutt peterschutt commented Jan 15, 2023

* ✨ feat(sentry): add starlite sentry integration

* ✅ test(sentry): add traces sampler test

* feat(sentry): disabled by default if environment "local" or "test"

Co-authored-by: Peter Schutt <[email protected]>
Adds an initial pass at a pytest plugin for testing `starlite-saqlalchemy` applications.

Includes the following fixtures:
* `is_unit_test`: a boolean that distinguishes between unit and integration tests
* `_patch_http_close`: an autouse fixture that prevents any globally instantiated http clients being closed between tests
* `_patch_sqlalchemy_plugin`: autouse fixture that patches the sqlalchemy plugin `on_shutdown` method for unittests
* `_patch_worker`: autouse fixture that patches the worker `on_app_startup` and `stop` methods for unit tests
* `app`: fixture that uses a defined import path to inject an application instance. Default path is `app.main:create_app`
* `client`: fixture that injects a starlite `TestClient` instance bound to the same app given by the `app` fixture
* `cap_logger`: a structlog capturing logger for inspecting log output

Closes #106
Closes #232
Better to let dependabot manage these for us too.
We are starting to amass a bit of functionality that is condition upon
the environment setting. E.g., sentry init disabled by default in
test and local environments, alternate logging config if environment is
local, and server reloading automatically configured for local
environment. So, it makes sense to have a bit more structure around
these checks.

Closes #244
With starlite-saqlalchemy installed, calling `run-app` will execute
`starlite_saqlalchemy.scripts.run_app()`.

Closes #243
If a method handler isn't registered, we ignore that test.

Closes #234
@peterschutt peterschutt enabled auto-merge (rebase) January 16, 2023 10:51
@peterschutt peterschutt merged commit 6221bab into main Jan 16, 2023
@peterschutt peterschutt deleted the 0.28 branch January 16, 2023 10:54
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants