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

fix(namespace): incorrect namespacing of test classes #325

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tests/asyncTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export class AsyncTests {
apexTestClassIdSet.add(item.ApexClass.Id);
// Can only query the FullName field if a single record is returned, so manually build the field
item.ApexClass.FullName = item.ApexClass.NamespacePrefix
? `${item.ApexClass.NamespacePrefix}__${item.ApexClass.Name}`
? `${item.ApexClass.NamespacePrefix}.${item.ApexClass.Name}`
: item.ApexClass.Name;

const diagnostic =
Expand Down
2 changes: 1 addition & 1 deletion src/tests/syncTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class SyncTests {
const apexTestClassIdSet = new Set<string>();

apiTestResult.successes.forEach(item => {
const nms = item.namespace ? `${item.namespace}__` : '';
const nms = item.namespace ? `${item.namespace}.` : '';
apexTestClassIdSet.add(item.id);
testResults.push({
id: '',
Expand Down
2 changes: 1 addition & 1 deletion test/reporters/humanReporter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('Human Reporter Tests', () => {
const result = reporter.format(testResults, false);
expect(result).to.not.be.empty;
expect(result).to.contain(
'AnimalLocatorTest.testMissingAnimal Fail System.AssertException: Assertion Failed: Should not have found an animal: Expected: FooBar, Actual:'
'AnimalLocatorTest.testMissingAnimal Fail System.AssertException: Assertion Failed: Should not have found an animal: Expected: FooBar, Actual:'
);
expect(result).to.contain(
'Class.AnimalLocatorTest.testMissingAnimal: line 22, column 1'
Expand Down
18 changes: 9 additions & 9 deletions test/reporters/testResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ export const testResults: TestResult = {
id: '01p3t000003qSzaAAE',
name: 'tt_UtilControllerTest',
namespacePrefix: 'trlhdtips',
fullName: 'trlhdtips__tt_UtilControllerTest'
fullName: 'trlhdtips.tt_UtilControllerTest'
},
runTime: 13,
testTimestamp: '2020-11-09T18:02:51.000+0000',
fullName: 'trlhdtips__tt_UtilControllerTest.testGetCurrentUser'
fullName: 'trlhdtips.tt_UtilControllerTest.testGetCurrentUser'
},
{
id: '07M3t000003bQwXEAU',
Expand All @@ -279,11 +279,11 @@ export const testResults: TestResult = {
id: '01p3t000003qSzaAAE',
name: 'tt_UtilControllerTest',
namespacePrefix: 'trlhdtips',
fullName: 'trlhdtips__tt_UtilControllerTest'
fullName: 'trlhdtips.tt_UtilControllerTest'
},
runTime: 179,
testTimestamp: '2020-11-09T18:02:51.000+0000',
fullName: 'trlhdtips__tt_UtilControllerTest.testResetMyPassword'
fullName: 'trlhdtips.tt_UtilControllerTest.testResetMyPassword'
},
{
id: '07M3t000003bQwlEAE',
Expand Down Expand Up @@ -357,11 +357,11 @@ export const testResults: TestResult = {
id: '01p3t000000i4L1AAI',
name: 'DashboardPalTest',
namespacePrefix: 'Dashboard_Pal',
fullName: 'Dashboard_Pal__DashboardPalTest'
fullName: 'Dashboard_Pal.DashboardPalTest'
},
runTime: 128,
testTimestamp: '2020-11-09T18:02:51.000+0000',
fullName: 'Dashboard_Pal__DashboardPalTest.testDashboardPal'
fullName: 'Dashboard_Pal.DashboardPalTest.testDashboardPal'
},
{
id: '07M3t000003bQx0EAE',
Expand Down Expand Up @@ -547,9 +547,9 @@ export const junitResult = `<?xml version="1.0" encoding="UTF-8"?>
<testcase name="testCallout" classname="AwesomeCalculatorTest" time="0.02">
<failure message=""></failure>
</testcase>
<testcase name="testGetCurrentUser" classname="trlhdtips__tt_UtilControllerTest" time="0.01">
<testcase name="testGetCurrentUser" classname="trlhdtips.tt_UtilControllerTest" time="0.01">
</testcase>
<testcase name="testResetMyPassword" classname="trlhdtips__tt_UtilControllerTest" time="0.18">
<testcase name="testResetMyPassword" classname="trlhdtips.tt_UtilControllerTest" time="0.18">
</testcase>
<testcase name="testGetCallout" classname="AnimalLocatorTest" time="0.02">
</testcase>
Expand All @@ -558,7 +558,7 @@ export const junitResult = `<?xml version="1.0" encoding="UTF-8"?>
</testcase>
<testcase name="testProcessing" classname="LeadProcessorTest" time="2.26">
</testcase>
<testcase name="testDashboardPal" classname="Dashboard_Pal__DashboardPalTest" time="0.13">
<testcase name="testDashboardPal" classname="Dashboard_Pal.DashboardPalTest" time="0.13">
</testcase>
<testcase name="testCountContacts" classname="AccountProcessorTest" time="0.24">
<failure message="System.AssertException: Assertion Failed: Incorrect count: Expected: 3, Actual: 2"><![CDATA[Class.AccountProcessorTest.testCountContacts: line 47, column 1]]></failure>
Expand Down
24 changes: 12 additions & 12 deletions test/tests/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ export const syncResult: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestApexClass',
namespacePrefix: 't3st',
fullName: 't3st__TestApexClass'
fullName: 't3st.TestApexClass'
},
runTime: 8,
testTimestamp: '',
fullName: `t3st__TestApexClass.testMethod`
fullName: `t3st.TestApexClass.testMethod`
}
]
};
Expand Down Expand Up @@ -168,11 +168,11 @@ export const testResultData: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestLogger',
namespacePrefix: 't3st',
fullName: 't3st__TestLogger'
fullName: 't3st.TestLogger'
},
runTime: 8,
testTimestamp: '3',
fullName: 't3st__TestLogger.testLoggerLog'
fullName: 't3st.TestLogger.testLoggerLog'
}
]
};
Expand Down Expand Up @@ -210,11 +210,11 @@ export const missingTimeTestData: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestLogger',
namespacePrefix: 't3st',
fullName: 't3st__TestLogger'
fullName: 't3st.TestLogger'
},
runTime: 0,
testTimestamp: '3',
fullName: 't3st__TestLogger.testLoggerLog'
fullName: 't3st.TestLogger.testLoggerLog'
}
]
};
Expand Down Expand Up @@ -252,11 +252,11 @@ export const skippedTestData: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestLogger',
namespacePrefix: 't3st',
fullName: 't3st__TestLogger'
fullName: 't3st.TestLogger'
},
runTime: 0,
testTimestamp: '3',
fullName: 't3st__TestLogger.testLoggerLog'
fullName: 't3st.TestLogger.testLoggerLog'
}
]
};
Expand Down Expand Up @@ -296,11 +296,11 @@ export const diagnosticResult: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestLogger',
namespacePrefix: 't3st',
fullName: 't3st__TestLogger'
fullName: 't3st.TestLogger'
},
runTime: 0,
testTimestamp: '3',
fullName: 't3st__TestLogger.testLoggerLog',
fullName: 't3st.TestLogger.testLoggerLog',
diagnostic: {
className: 'LIFXControllerTest',
columnNumber: 1,
Expand Down Expand Up @@ -331,11 +331,11 @@ export const diagnosticFailure: TestResult = {
id: '01pxx00000O6tXZQAZ',
name: 'TestLogger',
namespacePrefix: 't3st',
fullName: 't3st__TestLogger'
fullName: 't3st.TestLogger'
},
runTime: 0,
testTimestamp: '3',
fullName: 't3st__TestLogger.testLoggerLog',
fullName: 't3st.TestLogger.testLoggerLog',
diagnostic: {
className: 'LIFXControllerTest',
compileProblem: '',
Expand Down