Skip to content
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

chore: use webhook event fixtures and types provided by octokit #103

Merged
merged 2 commits into from
Nov 22, 2023

Conversation

remmycat
Copy link
Contributor

Changes:

  • Use event types by octokit, remove the existing github types.
  • Add more exhaustive typescript checks to the metrics (e.g. the metricsCondition checks that the event we got satisfies the exact type we assume to receive in the metric handler)
  • Use actual event mocks for the metricsCondition tests
  • Add snapshot tests for all metrics based on the sample events by octokit (sorry for the 50000 added lines 😅 Theoretically we could skip the snapshot of the input for every run and somehow test that separately, but I think when debugging a failed snapshot it's very valuable to have the exact input it used above, and to get per-test feedback if we update the fixture package)
  • Make sure the code review involvement metric explicitly reject unmerged PRs (I'm not sure if this is exactly what we want long-term but it is at least the current behaviour, since an unmerged PR crashed the metric handler).

@remmycat remmycat force-pushed the chore/better-test-fixtures branch from 1ac506a to 18fb37f Compare November 21, 2023 15:00
@remmycat remmycat merged commit 55670f7 into develop Nov 22, 2023
1 check passed
@remmycat remmycat deleted the chore/better-test-fixtures branch November 22, 2023 10:20
@remmycat remmycat mentioned this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants