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

Unit tests are failing, when running user's language is not English #271

Closed
derroman opened this issue Jan 16, 2022 · 2 comments · Fixed by #274
Closed

Unit tests are failing, when running user's language is not English #271

derroman opened this issue Jan 16, 2022 · 2 comments · Fixed by #274
Labels
Type: Bug Something isn't working

Comments

@derroman
Copy link

derroman commented Jan 16, 2022

Package Edition of Nebula Logger

Unlocked Package

Package Version of Nebula Logger

4.6.14

New Bug Summary

We are using NebulaLogger in several projects successfully. Unfortunately several unit tests are failing - all we the same root cause:

System.QueryException: List has no rows for assignment to SObject

The reason can be found here:

private static final Profile STANDARD_USER_PROFILE = [SELECT Id FROM Profile WHERE Name = 'Standard User' LIMIT 1];

This query - using a profile name as where clause - will fail, if the running user's language is not English. In our Orgs the user uses usually German as language, so the profile name will be "Standardbenutzer" instead of "Standard User". So this query fails.

Workaround:

  • Switch running user's language to English
@derroman derroman added the Type: Bug Something isn't working label Jan 16, 2022
@jongpie
Copy link
Owner

jongpie commented Jan 18, 2022

Hi @derroman - thanks for reporting this! I am nearly done with a fix for this - I'll include the fix for this issue in the next release. I'm not 100% sure when I'll have the release ready, but probably it will be done within the next few weeks.

jongpie added a commit that referenced this issue Jan 18, 2022
…le, using all possible translated names to ensure it works, regardless of the current user's specified language
@jongpie
Copy link
Owner

jongpie commented Mar 11, 2022

@derroman this should the new release v4.7.0 - I've changed the approach in some of the tests to no longer depend on a specific profile, which should avoid the issue with trying to query for profiles. Thanks again for reporting this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants