Skip to content

Commit

Permalink
test: add nut to test single label replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Mar 19, 2024
1 parent ce57e4e commit 777231e
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion test/nuts/local/replacements/replacementsLabels.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,37 @@ describe('e2e replacements test (customLabels)', () => {
await extractZip(zipBuffer, path.join(session.project.dir, 'unzipped'));
});

it('label replacements as expected', async () => {
it('label replacements as expected (CustomLabels)', async () => {
const labelsContents = await fs.promises.readFile(
path.join(session.project.dir, 'unzipped', 'labels', 'CustomLabels.labels'),
'utf8'
);
expect(labelsContents).to.not.include('original');
expect(labelsContents).to.include('REPLACED_LABEL');
});

it('label replacements as expected (CustomLabel)', async () => {
const converter = new MetadataConverter();
const cs = await ComponentSetBuilder.build({
metadata: {
metadataEntries: ['CustomLabel:Docs_CabinetId'],
directoryPaths: [path.join(session.project.dir, 'force-app')],
},
});
const { zipBuffer } = await converter.convert(cs, 'metadata', {
type: 'zip',
});
assert(zipBuffer, 'zipBuffer should be defined');
// extract zip files
await extractZip(zipBuffer, path.join(session.project.dir, 'unzipped2'));
const labelsContents = await fs.promises.readFile(
path.join(session.project.dir, 'unzipped2', 'labels', 'CustomLabels.labels'),
'utf8'
);
expect(labelsContents).to.not.include('original');
expect(labelsContents).to.include('REPLACED_LABEL');
});

it('class replacements as expected', async () => {
const classContents = await fs.promises.readFile(
path.join(session.project.dir, 'unzipped', 'classes', 'replaceStuff.cls'),
Expand Down

2 comments on commit 777231e

@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: 777231e Previous: ce57e4e Ratio
eda-componentSetCreate-linux 198 ms 196 ms 1.01
eda-sourceToMdapi-linux 2259 ms 1912 ms 1.18
eda-sourceToZip-linux 1796 ms 1737 ms 1.03
eda-mdapiToSource-linux 2877 ms 2809 ms 1.02
lotsOfClasses-componentSetCreate-linux 392 ms 357 ms 1.10
lotsOfClasses-sourceToMdapi-linux 3775 ms 3810 ms 0.99
lotsOfClasses-sourceToZip-linux 3229 ms 3127 ms 1.03
lotsOfClasses-mdapiToSource-linux 3578 ms 3500 ms 1.02
lotsOfClassesOneDir-componentSetCreate-linux 616 ms 606 ms 1.02
lotsOfClassesOneDir-sourceToMdapi-linux 6630 ms 6603 ms 1.00
lotsOfClassesOneDir-sourceToZip-linux 5768 ms 5886 ms 0.98
lotsOfClassesOneDir-mdapiToSource-linux 6433 ms 6414 ms 1.00

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: 777231e Previous: ce57e4e Ratio
eda-componentSetCreate-win32 406 ms 450 ms 0.90
eda-sourceToMdapi-win32 3477 ms 3609 ms 0.96
eda-sourceToZip-win32 2672 ms 2668 ms 1.00
eda-mdapiToSource-win32 5775 ms 6028 ms 0.96
lotsOfClasses-componentSetCreate-win32 895 ms 905 ms 0.99
lotsOfClasses-sourceToMdapi-win32 7610 ms 7580 ms 1.00
lotsOfClasses-sourceToZip-win32 4609 ms 4747 ms 0.97
lotsOfClasses-mdapiToSource-win32 7382 ms 7545 ms 0.98
lotsOfClassesOneDir-componentSetCreate-win32 1537 ms 1511 ms 1.02
lotsOfClassesOneDir-sourceToMdapi-win32 13689 ms 13884 ms 0.99
lotsOfClassesOneDir-sourceToZip-win32 8533 ms 8910 ms 0.96
lotsOfClassesOneDir-mdapiToSource-win32 13366 ms 13920 ms 0.96

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

Please sign in to comment.