Commit Graph

59 Commits

Author SHA1 Message Date
Klaas van Schelven 5930740e0b Tags: as a separate tab 2025-03-03 12:56:20 +01:00
Klaas van Schelven 934764dd8c Tests: Better error message for failing integration tests 2025-02-20 09:26:04 +01:00
Klaas van Schelven 9ee623de6b Add Event.grouping field and fill it
An event always has a single (automatically calculated) Grouping associated with it.
We add this info to the Event model (we'll soon display it in the UI, and as per the
now-removed comment it's simply the consistent thing to do)
2025-01-31 16:16:07 +01:00
Klaas van Schelven 43a6049180 Fix warning in tests (unclosed file) 2025-01-31 13:17:20 +01:00
Klaas van Schelven ba7472321a Fix broken import
broken in ae9cb209a5
2025-01-23 12:30:00 +01:00
Klaas van Schelven 4a28c51b6a Tests: Add known-broken handling for events that are invalid on purpose 2024-11-15 11:20:12 +01:00
Klaas van Schelven 3222c0d85e Fix the tests (missing initial data in transactiontestcase) 2024-11-15 10:14:01 +01:00
Klaas van Schelven 9db0b121ec Further HTML correctness checks; by not going through Firefox a few more issues were unhidden 2024-09-26 16:14:51 +02:00
Klaas van Schelven 096d1f7d9a Add 'samples' tests as such explicitly 2024-09-19 13:10:13 +02:00
Klaas van Schelven f2a78fed9d Use the envelope's event_id when using the envelope endpoint
* As per the spec 'takes precendence'
* Also fixes the reported bug on Laravel, which apparently doesn't send event_id
  as part of the event payload.
* Fixes the envelope tests (they were doing nothing when I moved the
  data samples around recently)
* Adds a 'no event_id in data, but yes in envelope' test to that test.
* Adds handling to send_json such that we can send envelopes when the event_id
  is missing from the event data.
2024-09-18 11:36:47 +02:00
Klaas van Schelven c5465f2f8a Don't assume samples miss the 'timestamp' property
(we have fixed the samples accordingly)
2024-09-17 09:38:08 +02:00
Klaas van Schelven 519c09b662 Syntax error fix 2024-09-16 14:19:34 +02:00
Klaas van Schelven f1b75aab81 api.json.schema: put back in code, make test fail on invalidness and related fixes
This reverts course on 4201fbd778, and restores event.schema.json from that
commit.  In that commit we said: 'this is not used'. Not true: it's used in a
test, though this test used the validity check to silently skip.

In this commit:

1. Do _not_ just silently skip invalid samples. Since we have a way of properly
   validating, let's use that so that we know how useful the samples that we have
   actually are.

2. Deal with "_meta", a field that we sometimes see in the "private samples" (data
   that ultimately comes from running a somewhat recent python-sdk against my
   actual codebase). The need for this was exposed by [1]

3. Add a test for the up-to-date-ness of event.json.schema

4. remove special-cased attribute-checks in `is_valid`; `send_json` was, at the
   time, an opportunistic way to just get my hands on some sample data. the
   approach at validation reflected that: I just did some tests on the existence
   of certain attributes to determine which json files were even events. But in
   the end I did a full validation using an API schema, which kinda made the
   whole business useless. This commit cleans up the individual checks.
2024-09-16 11:28:05 +02:00
Klaas van Schelven 55aa917436 Integration test using the extracted event-samples 2024-09-13 11:46:25 +02:00
Klaas van Schelven 9e4b326ab6 whitespace 2024-09-12 12:41:22 +02:00
Klaas van Schelven 10c91ccbdc fix tests
recently introduced (e59fd3a225) caching made it so that repeated calls to
create_release_if_needed no longer work if releases have been created in the
meantime.

In actual usage create_release_if_needed is always called on a single project
so I _think_ just calling `fresh` in the tests is good way to get to green
tests again.
2024-09-12 12:17:47 +02:00
Klaas van Schelven 1bfac5d8c6 assertEquals -> assertEual (Python 3.12)
<<insert remarks about fashion police>>
2024-08-21 08:49:49 +02:00
Klaas van Schelven b76e474ef1 Navigation: fix for missing events
Now that we have eviction, events may disappear. Deal with it:

* event-specific 404 that still allows for navigation
* first/last buttons
* navigation to prev/next when prev/next is not just 1 step away
* don't use HttpRedirect for "lookup based" views
    in principle, the thing you were looking for might go missing in-between
    drawback: these URLs are not "stable"
2024-07-19 11:03:08 +02:00
Klaas van Schelven d56a8663a7 Remove the periodCounter and the PC registry
direct consequence of switching to SQL-based counting
2024-07-16 15:08:05 +02:00
Klaas van Schelven d68aff05ca Quota 2024-07-15 09:37:36 +02:00
Klaas van Schelven edff0e219c PeriodCounter: remove event-based approach
Replacing it with passing the thresholds on each call to `inc`.

The event-based approach was broken in a multi-process setup (such as having a separate
gunicorn and snappea), because the unmute events would be registered GUI-side
(gunicorn), and the single process where the counting happened had a different PC
instance.

The solution is to get rid of the event-listener approach, and just make an inventory of
the threshold-checks that need to be done right before each call to `inc`. Because the
calls to `inc` happen in a single process (we [will] enforce this elsewhere) this fixes
the problem.

During refactoring it became clear that this is probably a good idea anyway: many
comments about corner-cases could be removed.

Other things I found:

* The now-removed `_digest_event_python_postprocessing` did more than Python alone (it
  also touched the DB for unmutes) so that was probably a separate bug (now fixed).

* In the event-listener-based code, I foresaw the need for `on_become_false` (but did
  not use it yet). The idea was probably that this could be useful in the quota setting
  (a quota can become unmet after a while) but in fact it isn't useful, because when a
  quota becomes unmet you'd still need to check all quota and OR them.

Tests have not been truly refactored (the new architecture probably points to a new
desired set of tests) but rather have been made to run in the simplest way possible.
2024-07-09 09:31:36 +02:00
Klaas van Schelven c4358aaece Fix tests for users.User idiom 2024-06-12 17:45:06 +02:00
Klaas van Schelven 8d23239526 Be more strict about usage of TransactionTestCase in tests 2024-04-27 20:35:35 +02:00
Klaas van Schelven c50780ab4e Use atomic transactions in views 2024-04-18 13:15:46 +02:00
Klaas van Schelven d89e3d4dd5 Add 'next-materialized historic annotation 2024-04-16 09:31:12 +02:00
Klaas van Schelven 2c4e8b9f20 Regular v.s. Django Testcase: be explicit
I recently ran into a funny issue where the TestCases were influencing my
development DB's contents
2024-04-15 09:17:53 +02:00
Klaas van Schelven 280bd2172b History page: 'mostly done' (a first setup) 2024-04-12 16:07:25 +02:00
Klaas van Schelven 729a4c7ea1 Make <no transaction> explicit;
and more moving-around-of-code in preparation for our next step
2024-04-08 15:03:02 +02:00
Klaas van Schelven cb75d318af Remove the event_type_name from the grouper
it adds very little, especially now that we've put this information in the type
('Log Message') and removing this allows us to refactor more freely
2024-04-08 14:52:09 +02:00
Klaas van Schelven 8d17e7b128 For log messages, demote the msg into the value
and make the type 'Log Message'.
This may just be a matter of personal taste, but I've always found these
messages-as-type super-confusing. I'd rather have some made up (but clear,
and thanks to the whitespace unlikely-to-otherwise-exist) type "Log Message".

This is also inline in what I've already done in the UI.
2024-04-08 14:48:39 +02:00
Klaas van Schelven 9dfae5a829 Use the diamond-separator when generating fingerprint-based groupers too 2024-04-05 15:41:12 +02:00
Klaas van Schelven eaa5ee6838 Tests for existing grouping functionality 2024-04-05 12:10:51 +02:00
Klaas van Schelven 09a716a8d7 Stacktrace ordering: stack-of-plates as an option
implemented in-python; doing this using flex quickly became a mess
2024-04-04 10:40:32 +02:00
Klaas van Schelven f40ee395ee Make issues/templatetags more robust
(the need for which was exposed by the recently added tests)
2024-04-03 10:15:13 +02:00
Klaas van Schelven 17b5c0d089 Add integration test for issue-ingestion & rendering 2024-04-03 09:52:50 +02:00
Klaas van Schelven 3ffa0f9671 issue-views: test for project membership 2024-03-25 23:38:17 +01:00
Klaas van Schelven 6100767548 Add view tests for issues 2024-03-25 23:06:41 +01:00
Klaas van Schelven feba3b7410 'is_regression' fix when seeing your first real release 2024-03-19 22:28:20 +01:00
Klaas van Schelven 624cfd3f0f IssueStatemanager improvements
* triggerd_by_event instead of implicitly called (see test for why)
* IngruentStateException check
2024-03-14 20:15:31 +01:00
Klaas van Schelven 20361ce75a Date/issue_count correct in list_view 2024-02-20 17:49:48 +01:00
Klaas van Schelven 6543c33961 Tests for IssueStateManager.mute 2024-01-12 22:44:15 +01:00
Klaas van Schelven de4d55eaf1 Guard against already-true unmute-conditions 2024-01-12 22:41:41 +01:00
Klaas van Schelven 0a616f5c92 Unmute/mute further work
* IssueStateManager.mute
* IssueStateManager.unmute (from Issue.unmute)
* more tests for alerts
* unmute moved to IssueStateManager
* create_unmute_issue_handler moved-over to models.py
2024-01-12 22:15:50 +01:00
Klaas van Schelven 88e10b1621 Note on pc-registry and tests 2024-01-10 22:46:00 +01:00
Klaas van Schelven 6c097b215a Rename -> IssueStateManager 2024-01-10 22:44:56 +01:00
Klaas van Schelven 8766e2ccfe new-issue and regression alerts (not actually implemented, but the call is) 2024-01-10 17:14:49 +01:00
Klaas van Schelven 360d222472 Muting: test case for simultaneous unmute 2024-01-10 17:06:03 +01:00
Klaas van Schelven 17b6758e6b unmute alerts (not actually implemented, but the call is) 2024-01-10 08:43:06 +01:00
Klaas van Schelven f4dedc9319 unmute as a separate thing to test (Yesterday's work) 2024-01-10 08:22:23 +01:00
Klaas van Schelven ad08a6def5 More rabbit-hole thought about explicit reopening 2023-12-14 22:57:32 +01:00