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

SYNCHRONOUS_DML in a test context - Integration test #457

Closed
jongpie opened this issue Feb 23, 2023 Discussed in #454 · 1 comment · Fixed by #813
Closed

SYNCHRONOUS_DML in a test context - Integration test #457

jongpie opened this issue Feb 23, 2023 Discussed in #454 · 1 comment · Fixed by #813
Assignees
Labels
Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex tests Relates to Apex or LWC jest tests Type: Bug Something isn't working

Comments

@jongpie
Copy link
Owner

jongpie commented Feb 23, 2023

Discussed in #454

Originally posted by JeroenSfdc February 22, 2023
If I'd like to do an integration test with SYNCHRONOUS_DML it fails (where it succeeds with EVENT_BUS).
I tried to get my head around this... This is using the managed package v4.8 v4.9. @jongpie

    @IsTest
    static void testNebula_SyncDML() {
        Nebula.Logger.error('Some random error');

        Test.startTest();
        Nebula.Logger.saveLog(Nebula.Logger.SaveMethod.SYNCHRONOUS_DML);
        Test.stopTest();

        Assert.areEqual(1, [SELECT Id FROM Nebula__Log__c].size());
        Assert.areEqual(1, [SELECT Id FROM Nebula__LogEntry__c].size());
    }
@jongpie jongpie added Type: Bug Something isn't working Logging Source: Apex Items related to using Logger within Apex Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app tests Relates to Apex or LWC jest tests labels Feb 23, 2023
@jongpie jongpie self-assigned this Feb 23, 2023
@jongpie jongpie removed this from the Version 4.12.0: Winter '24 Release milestone Sep 14, 2023
@jongpie jongpie removed this from the Version 4.15.0: Winter '25 Release milestone Aug 23, 2024
@jongpie jongpie added the Layer: Logger Engine Items related to the core logging engine label Oct 15, 2024
@jongpie
Copy link
Owner Author

jongpie commented Dec 30, 2024

This is now fixed in release v4.15.3 of the unlocked package🥳And it will be fixed in the next release of the managed package, v4.16.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Layer: Configuration Items related to the custom hierarchy setting LoggerSettings__c or any included custom metadata type Layer: Log Management Items related to the custom objects & Logger Console app Layer: Logger Engine Items related to the core logging engine Logging Source: Apex Items related to using Logger within Apex tests Relates to Apex or LWC jest tests Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant