Skip to content

Commit

Permalink
chore: add UT logging
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Sep 10, 2024
1 parent 1da93af commit f4b7033
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 138 deletions.
134 changes: 0 additions & 134 deletions test/mock/type-constants/decomposedPermissionSetConstant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,137 +384,3 @@ export const ONLY_PS_PARENT = new SourceComponent(
},
])
);

// export const THREE_CUSTOM_LABELS_CMP = new SourceComponent(
// {
// name: 'CustomLabels',
// type: permissionSet,
// xml: join('labels', MDAPI_XML_NAME),
// },
// new VirtualTreeContainer([
// {
// dirPath: 'permissionSet',
// children: [
// {
// name: MDAPI_XML_NAME,
// data: Buffer.from(`<?xml version="1.0" encoding="UTF-8"?>
// <CustomLabels xmlns="http://soap.sforce.com/2006/04/metadata">
// <labels>
// <fullName>DeleteMe</fullName>
// <language>en_US</language>
// <protected>true</protected>
// <shortDescription>DeleteMe</shortDescription>
// <value>Test</value>
// </labels>
// <labels>
// <fullName>KeepMe1</fullName>
// <language>en_US</language>
// <protected>true</protected>
// <shortDescription>KeepMe1</shortDescription>
// <value>Test</value>
// </labels>
// <labels>
// <fullName>KeepMe2</fullName>
// <language>en_US</language>
// <protected>true</protected>
// <shortDescription>KeepMe2</shortDescription>
// <value>Test</value>
// </labels>
// </CustomLabels>`),
// },
// ],
// },
// ])
// );
//
// const ONLY_LABEL_CONTENTS = `<?xml version="1.0" encoding="UTF-8"?>
// <CustomLabel xmlns="http://soap.sforce.com/2006/04/metadata">
// <fullName>OnlyLabel</fullName>
// <language>en_US</language>
// <protected>true</protected>
// <shortDescription>OnlyLabel</shortDescription>
// <value>OnlyLabel</value>
// </CustomLabel>`;
//
// export const ONLY_LABEL_CMP_IN_DEFAULT_DIR_CMP = new SourceComponent(
// {
// name: 'OnlyLabel',
// type: customLabelType,
// xml: join('main', 'default', 'labels', 'OnlyLabel.label-meta.xml'),
// },
// new VirtualTreeContainer([
// {
// dirPath: join('main', 'default', 'labels'),
// children: [
// {
// name: 'OnlyLabel.label-meta.xml',
// data: Buffer.from(ONLY_LABEL_CONTENTS),
// },
// ],
// },
// ])
// );
//
// export const ONLY_LABEL_CMP_IN_ANOTHER_DIR_CMP = new SourceComponent(
// {
// name: 'OnlyLabel',
// type: customLabelType,
// xml: join('other', 'dir', 'labels', 'OnlyLabel.label-meta.xml'),
// },
// new VirtualTreeContainer([
// {
// dirPath: join('other', 'dir', 'labels'),
// children: [
// {
// name: 'OnlyLabel.label-meta.xml',
// data: Buffer.from(ONLY_LABEL_CONTENTS),
// },
// ],
// },
// ])
// );
//
// export const ONLY_LABEL_NO_DIR_CMP = new SourceComponent(
// {
// name: 'OnlyLabel',
// type: customLabelType,
// xml: 'OnlyLabel.label-meta.xml',
// },
// new VirtualTreeContainer([
// {
// dirPath: '',
// children: [
// {
// name: 'OnlyLabel.label-meta.xml',
// data: Buffer.from(ONLY_LABEL_CONTENTS),
// },
// ],
// },
// ])
// );
//
// export const OTHER_LABEL_CMP = new SourceComponent(
// {
// name: 'OtherLabel',
// type: customLabelType,
// xml: join('labels', 'OtherLabel.label-meta.xml'),
// },
// new VirtualTreeContainer([
// {
// dirPath: 'permissionSet',
// children: [
// {
// name: 'OtherLabel.label-meta.xml',
// data: Buffer.from(`<?xml version="1.0" encoding="UTF-8"?>
// <CustomLabel xmlns="http://soap.sforce.com/2006/04/metadata">
// <fullName>OtherLabel</fullName>
// <language>en_US</language>
// <protected>true</protected>
// <shortDescription>OtherLabel</shortDescription>
// <value>OtherLabel</value>
// </CustomLabel>`),
// },
// ],
// },
// ])
// );
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('COT / COFT snapshots', () => {
await fileSnap(file, testDir);
}

await dirsAreIdentical(
dirsAreIdentical(
path.join(testDir, FORCE_APP),
path.join(testDir, '__snapshots__', 'verify-source-files.expected', FORCE_APP)
);
Expand Down
6 changes: 3 additions & 3 deletions test/snapshot/sampleProjects/mpdWithLabels/snapshots.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ describe('recompose/decompose mpd project with labels', () => {
// painfully repetitive, but the async nature makes dynamic testing even uglier
it(`verify ${pkgDirs[0]}`, async () => {
await validateSourceDir(pkgDirs[0]);
await dirsAreIdentical(
dirsAreIdentical(
path.join(testDir, pkgDirs[0]),
path.join(testDir.replace(tmpFolder, folder), '__snapshots__', pkgNameToTestName(pkgDirs[0]), pkgDirs[0])
);
});
it(`verify ${pkgDirs[1]}`, async () => {
await validateSourceDir(pkgDirs[1]);
await dirsAreIdentical(
dirsAreIdentical(
path.join(testDir, pkgDirs[1]),
path.join(testDir.replace(tmpFolder, folder), '__snapshots__', pkgNameToTestName(pkgDirs[1]), pkgDirs[1])
);
});
it(`verify ${pkgDirs[2]}`, async () => {
await validateSourceDir(pkgDirs[2]);
await dirsAreIdentical(
dirsAreIdentical(
path.join(testDir, pkgDirs[2]),
path.join(testDir.replace(tmpFolder, folder), '__snapshots__', pkgNameToTestName(pkgDirs[2]), pkgDirs[2])
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ describe('fully decomposed permission set via decomposePermissionSetBeta2', () =
}
});
it('round trip of metadata format is equivalent', async () => {
// eslint-disable-next-line no-console
console.log(fs.readdirSync(path.join(testDir)));
// eslint-disable-next-line no-console
console.log(fs.readdirSync(path.join(testDir, MDAPI_OUT))); // eslint-disable-next-line no-console
console.log(fs.readdirSync(path.join(testDir, MDAPI_OUT, 'permissionsets')));
const [old, updated] = await Promise.all([
fs.promises.readFile(path.join(testDir, 'originalMdapi', 'permissionsets', 'dreamhouse.permissionset'), 'utf8'),
fs.promises.readFile(path.join(testDir, MDAPI_OUT, 'permissionsets', 'dreamhouse.permissionset'), 'utf8'),
Expand Down

2 comments on commit f4b7033

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: f4b7033 Previous: 1da93af Ratio
eda-componentSetCreate-linux 234 ms 247 ms 0.95
eda-sourceToMdapi-linux 2352 ms 2584 ms 0.91
eda-sourceToZip-linux 1891 ms 1994 ms 0.95
eda-mdapiToSource-linux 2893 ms 3057 ms 0.95
lotsOfClasses-componentSetCreate-linux 437 ms 455 ms 0.96
lotsOfClasses-sourceToMdapi-linux 3795 ms 3888 ms 0.98
lotsOfClasses-sourceToZip-linux 3096 ms 3395 ms 0.91
lotsOfClasses-mdapiToSource-linux 3620 ms 3783 ms 0.96
lotsOfClassesOneDir-componentSetCreate-linux 755 ms 796 ms 0.95
lotsOfClassesOneDir-sourceToMdapi-linux 6537 ms 6864 ms 0.95
lotsOfClassesOneDir-sourceToZip-linux 5628 ms 6173 ms 0.91
lotsOfClassesOneDir-mdapiToSource-linux 6563 ms 6811 ms 0.96

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: f4b7033 Previous: 1da93af Ratio
eda-componentSetCreate-win32 619 ms 714 ms 0.87
eda-sourceToMdapi-win32 4338 ms 4844 ms 0.90
eda-sourceToZip-win32 3058 ms 3290 ms 0.93
eda-mdapiToSource-win32 5664 ms 6278 ms 0.90
lotsOfClasses-componentSetCreate-win32 1213 ms 1221 ms 0.99
lotsOfClasses-sourceToMdapi-win32 7580 ms 7723 ms 0.98
lotsOfClasses-sourceToZip-win32 4989 ms 5121 ms 0.97
lotsOfClasses-mdapiToSource-win32 7761 ms 7873 ms 0.99
lotsOfClassesOneDir-componentSetCreate-win32 2076 ms 2167 ms 0.96
lotsOfClassesOneDir-sourceToMdapi-win32 13616 ms 13833 ms 0.98
lotsOfClassesOneDir-sourceToZip-win32 9374 ms 9261 ms 1.01
lotsOfClassesOneDir-mdapiToSource-win32 14187 ms 14301 ms 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.