Skip to content

Fix NLog failing tests #686

Closed
Closed

Description

@bruno-garcia

2 Tests from NLog are failing and got skipped:

Log_SourceContextMatchesSentry_NoScopeConfigured()
Log_SourceContextContainsSentry_NoScopeConfigured()

No noticeable regression was detected and to unblock a PR they were just skipped But someone familiar with NLog hopefully can chime in on these. Are they still needed? If so why are they failing yet we can't identify any issues.

Activity

  1. SimonCropp commented on Oct 6, 2021

    @SimonCropp
    Contributor

    i dont understand how this could ever work.

    those tests assert

    _fixture.Hub.DidNotReceive().ConfigureScope(Arg.Any<Action<Scope>>());
    

    but ConfigureScope is called in the constructor of

                public Fixture()
                {
                    _ = Hub.IsEnabled.Returns(true);
                    HubAccessor = () => Hub;
                    Scope = new Scope(new SentryOptions());
                    Hub.ConfigureScope(Arg.Invoke(Scope));
                }
    

    am i missing something obvious?

  2. self-assigned this
    on Oct 6, 2021
  3. josh-degraw commented on Oct 6, 2021

    @josh-degraw
    Contributor

    So it looks like I'm the one who originally put these tests in there, but I basically just copied them from the serilog integration's tests at the time. I'm not sure if there was another reason why serilog specifically needed to do this, but it appears the intention of these tests was to prevent errors that originated from the SDK from being included? Regardless, I think these tests can be safely removed, as you're right, they don't look like they should ever pass, and what they seem to be asserting doesn't need to be tested for IMO.

  4. added a commit that references this issue on Oct 6, 2021
    9380558
  5. added a commit that references this issue on Oct 6, 2021
    ea877c7
  6. SimonCropp commented on Oct 6, 2021

    @SimonCropp
    Contributor

    @josh-degraw thanks for the extra context

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

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions