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

fix(linux): Fix detection of unit tests #9606

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

ermshiperete
Copy link
Contributor

When running on Ubuntu 20.04 Focal, one of the Python dependencies loads the unittest module so that running km-config output the message that Sentry would be disabled because unit tests are running.

This change now uses the call stack to check if we're running unit tests.

Fixes #9577.

User Testing

  • The test should be run on Ubuntu 20.04 Focal with Gnome Shell and X11

TEST_VERIFY: start km-config from the command line and verify that no output is shown

When running on Ubuntu 20.04 Focal, one of the Python dependencies
loads the `unittest` module so that running `km-config` output the
message that Sentry would be disabled because unit tests are running.

This change now uses the callstack to check if we're running unit
tests.

Fixes #9577.
@keymanapp-test-bot keymanapp-test-bot bot added has-user-test user-test-required User tests have not been completed labels Sep 21, 2023
@keymanapp-test-bot
Copy link

keymanapp-test-bot bot commented Sep 21, 2023

User Test Results

Test specification and instructions

  • TEST_VERIFY (PASSED): Tested with the attached PR build (Keyman 17.0.178-alpha-local (package version 17.0.178-1~PR-9606-1288.1+focal1) in Ubuntu 20.04 Focal Linux OS and here is my observation: 1. Run km-config command line on the terminal window. 2. The Keyman Configuration dialog opens on the screen. 3. No message appears on the terminal window. (notes)

Test Artifacts

Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

It feels a little squirmy (especially given the slow case for the search is the production case), and I wonder how often is_sentry_enabled is called. Should we be caching the result; is traceback.format_stack() expensive?

But I guess LGTM otherwise 😁

@ermshiperete
Copy link
Contributor Author

It gets called at the startup of km-config, and if the user changes the "Automatically report errors to keyman.com", so I don't think we need to cache the result.

@bharanidharanj
Copy link

Test Results

  • TEST_VERIFY (PASSED): Tested with the attached PR build (Keyman 17.0.178-alpha-local (package version 17.0.178-1~PR-9606-1288.1+focal1) in Ubuntu 20.04 Focal Linux OS and here is my observation: 1. Run km-config command line on the terminal window. 2. The Keyman Configuration dialog opens on the screen. 3. No message appears on the terminal window.

@keymanapp-test-bot keymanapp-test-bot bot removed the user-test-required User tests have not been completed label Sep 22, 2023
@ermshiperete ermshiperete merged commit 9b3bf85 into master Sep 25, 2023
3 checks passed
@ermshiperete ermshiperete deleted the fix/linux/9577_testdetection branch September 25, 2023 08:54
@keyman-server
Copy link
Collaborator

Changes in this pull request will be available for download in Keyman version 17.0.180-alpha

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

Successfully merging this pull request may close these issues.

bug(linux): Ubuntu 20.04 Focal reports running user tests when starting km-config
4 participants