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

[BUG] Run tests with coverage with namespace - fails to detect coverage generated due to full name comparison #12

Open
JonnyPower opened this issue Feb 9, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@JonnyPower
Copy link

Describe the bug
When running sfp apextests:trigger -u <org> -l RunAllTestsInPackage -c -n <dir> against a namespaced org, the cli fails to detect coverage as generated because

if (!testToBeTriggered.includes(test.apexClass.fullName)) {
    testClassesThatDonotContributedCoverage.push(test.apexClass.fullName);
    if (!testToBeTriggered.includes(test.apexClass.fullName))
        testToBeTriggered.push(test.apexClass.fullName);
}

is comparing the namespaced name against testToBeTriggered which is without namespace.

To Reproduce
Steps to reproduce the behavior:

  1. Create test class in namespace org
  2. Use SFP to run tests with coverage
  3. Observe errors reported to stdout;
Tests to be executed: Foo

later;

Test Classes that were not able to contribute coverage: NAMESPACE.Foo

Expected behaviour
Should properly detect comparison with or without namespace - at risk of colliding coverage results if an unnamespaced class has the same name

Creating this issue with intention of submitting a PR shortly

@azlam-abdulsalam azlam-abdulsalam added bug Something isn't working and removed analysis labels Feb 9, 2024
@azlam-abdulsalam azlam-abdulsalam added this to the February 2024 milestone Feb 9, 2024
@azlam-abdulsalam azlam-abdulsalam removed this from the February 2024 milestone Feb 21, 2024
@dieffrei dieffrei self-assigned this May 27, 2024
@dieffrei
Copy link
Collaborator

Hey @JonnyPower even if you have just a draft of PR, I'm happy to take a look and finish it.
let me know ;)

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

No branches or pull requests

3 participants