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

test: Isolated testing and SentryOptions tests #80

Draft
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

limbonaut
Copy link
Collaborator

@limbonaut limbonaut commented Jan 30, 2025

This PR introduces isolated testing and several new testing goodies:

  • Introduce isolated testing: tests that need to be executed separately from other tests (in a separate process).
    • Enable isolated tests to configure the SDK options.
    • New test suites that verify the SDK flow.
    • New script to execute isolated tests in a batch.
    • Run isolated tests in a CI step.
  • Test suites covering SentryOptions, error logger, and more.
  • Ignore the test reports directory in Git.

Isolated tests are good for testing various SDK options, as we may configure those only once and only at the app start.

Closes #75

#skip-changelog

@limbonaut limbonaut changed the title Test/isolated and options tests test: Isolated testing and SentryOptions tests Jan 30, 2025
@@ -2,6 +2,7 @@
project/addons
project/export_presets.cfg
project/.vscode
project/reports
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For information, reports are created when unit tests are executed in the editor or from CLI.

@@ -16,6 +16,9 @@ func _configure(options: SentryOptions) -> void:
options.before_send = _before_send
options.on_crash = _on_crash

# Unit testing hooks (if you're exploring the demo project, pretend the following line doesn't exist).
TestingConfiguration.configure_options(options)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allowing unit tests to hook into our configuration script. I call such tests isolated, as they need to be executed separately from other similar tests. There is a new script that automates running them in a batch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: This would break if the demo project were shipped without unit test files, which is how we currently do it.

@limbonaut limbonaut marked this pull request as ready for review January 31, 2025 12:17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One advantage of writing the script in pwsh is that we can run these on Windows/macOS/Linux

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6aefa3c

@limbonaut limbonaut force-pushed the test/isolated-and-options-tests branch from a4fad5f to 5f00372 Compare February 7, 2025 15:43
@limbonaut limbonaut marked this pull request as draft February 7, 2025 17:05
@limbonaut
Copy link
Collaborator Author

I have to give it another look. Something fishy is going on when I run these tests in a different environment.

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

Successfully merging this pull request may close these issues.

Add Unit tests for SentryOptions
2 participants