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

2 logger unit tests fail #7

Open
xixiaofinland opened this issue Feb 24, 2020 · 2 comments
Open

2 logger unit tests fail #7

xixiaofinland opened this issue Feb 24, 2020 · 2 comments

Comments

@xixiaofinland
Copy link

I deployed the solution into a scratch org and 2 unit tests fail

  • sendLog_UserBasedLogging_Success

  • logTrigger_AllVariations_Success
    line 194, there shouldn't be any logEntry in database, why assert 1?

@Szandor72 Szandor72 mentioned this issue Jul 31, 2020
@Szandor72
Copy link
Owner

Also mentioned in #9

Thanks for being patient @xixiaofinland and @arafesthain

I checked out the code as is, pushed, assigned permset, and ran the tests successfully.

08:47:25.675 sfdx force:apex:test:run --classnames LoggerTest --resultformat human --outputdir /Users/szandor/dev/logger/.sfdx/tools/testresults/apex --loglevel error
=== Test Reports
FORMAT  FILE
──────  ────────────────────────────────────────────────────────────────────────────────────────────
txt     /Users/szandor/dev/logger/.sfdx/tools/testresults/apex/test-result.txt
txt     /Users/szandor/dev/logger/.sfdx/tools/testresults/apex/test-run-id.txt
junit   /Users/szandor/dev/logger/.sfdx/tools/testresults/apex/test-result-7071j00000qIbon-junit.xml
json    /Users/szandor/dev/logger/.sfdx/tools/testresults/apex/test-result-7071j00000qIbon.json

=== Test Results
TEST NAME                                              OUTCOME  MESSAGE  RUNTIME (MS)
─────────────────────────────────────────────────────  ───────  ───────  ────────────
LoggerTest.disabledLogging                             Pass              19
LoggerTest.getLogJSON_Success                          Pass              20
LoggerTest.handleJSONLength_Success                    Pass              19
LoggerTest.LogEntry_Constructor_Success                Pass              209
LoggerTest.logException_Success                        Pass              18
LoggerTest.logTrigger_AllVariations_Success            Pass              213
LoggerTest.log_MessageGiven_Success                    Pass              18
LoggerTest.log_setLogEntryAttributes_Success           Pass              17
LoggerTest.log_setMethodName_Success                   Pass              18
LoggerTest.popAll_DecrementsLogLevel_Success           Pass              54
LoggerTest.pop_DecrementsLogLevel_Success              Pass              21
LoggerTest.printLog_Success                            Pass              20
LoggerTest.push_IncrementsLogLevel_Success             Pass              19
LoggerTest.push_setMethodName_Success                  Pass              21
LoggerTest.sendLog_Fail_EnableLoggingBeatsSaveAllLogs  Pass              59
LoggerTest.sendLog_Fail_InvalidTrace                   Pass              62
LoggerTest.sendLog_Success                             Pass              260
LoggerTest.sendLog_UserBasedLogging_Success            Pass              195

=== Test Summary
NAME                 VALUE
───────────────────  ──────────────────────────────────────────────────────────────
Outcome              Passed
Tests Ran            18
Passing              18
Failing              0
Skipped              0
Pass Rate            100%
Fail Rate            0%
Test Start Time      Jul 31, 2020 8:47 AM
Test Execution Time  1262 ms
Test Total Time      1262 ms
Command Time         5368 ms
Hostname             https://agility-business-6530-dev-ed.cs102.my.salesforce.com/
Org Id               00D1j0000001d2SEAQ
Username             test-l6xjzi7vtu4o@example.com
Test Run Id          7071j00000qIbon
User Id              0051j000004GhasAAC

I need a reproduction if this issue persists.

@arafesthain
Copy link

arafesthain commented Aug 10, 2020

Thanks @Szandor72, in my opinion permission set should be assigned to a test user and then test run as this user to not be dependent of current running/deploying one (hence more CI/CD friendly)

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

No branches or pull requests

3 participants