Skip to content

Commit

Permalink
chore: add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
shetzel committed Nov 5, 2024
1 parent 648551b commit b4eebe8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/resolve/metadataResolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,24 @@ describe('MetadataResolver', () => {
expect(access.getComponentsFromPath(path).length).to.equal(0);
});

it('Should not throw TypeInferenceError for a non-metadata file that is not part of an inclusive filter', () => {
const emailservicesPath = join('unpackaged', 'emailservices', 'MyEmailServices.xml');
const nonMetadataDirPath = join('unpackaged', 'datasets');
const nonMetadataFilePath = join(nonMetadataDirPath, 'myDS.xml');
const emailservicesComponent = new SourceComponent(
{
name: 'MyEmailServices',
type: registry.types.emailservicesfunction,
xml: emailservicesPath,
},
VirtualTreeContainer.fromFilePaths([emailservicesPath])
);
const filter = new ComponentSet([emailservicesComponent]);
const treeContainer = VirtualTreeContainer.fromFilePaths([emailservicesPath, nonMetadataFilePath]);
const mdResolver = new MetadataResolver(undefined, treeContainer, false);
expect(mdResolver.getComponentsFromPath(nonMetadataDirPath, filter)).to.deep.equal([]);
});

it('Should not return a component if path to folder metadata xml is forceignored', () => {
const path = xmlInFolder.FOLDER_XML_PATH;
const access = testUtil.createMetadataResolver([
Expand Down

2 comments on commit b4eebe8

@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: b4eebe8 Previous: 648551b Ratio
eda-componentSetCreate-linux 211 ms 215 ms 0.98
eda-sourceToMdapi-linux 1913 ms 2006 ms 0.95
eda-sourceToZip-linux 1719 ms 1771 ms 0.97
eda-mdapiToSource-linux 2612 ms 2681 ms 0.97
lotsOfClasses-componentSetCreate-linux 473 ms 431 ms 1.10
lotsOfClasses-sourceToMdapi-linux 3422 ms 3563 ms 0.96
lotsOfClasses-sourceToZip-linux 2844 ms 2880 ms 0.99
lotsOfClasses-mdapiToSource-linux 3317 ms 3331 ms 1.00
lotsOfClassesOneDir-componentSetCreate-linux 733 ms 741 ms 0.99
lotsOfClassesOneDir-sourceToMdapi-linux 6067 ms 6199 ms 0.98
lotsOfClassesOneDir-sourceToZip-linux 4871 ms 5052 ms 0.96
lotsOfClassesOneDir-mdapiToSource-linux 5915 ms 5996 ms 0.99

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: b4eebe8 Previous: 648551b Ratio
eda-componentSetCreate-win32 606 ms 602 ms 1.01
eda-sourceToMdapi-win32 3758 ms 3622 ms 1.04
eda-sourceToZip-win32 2880 ms 2816 ms 1.02
eda-mdapiToSource-win32 5641 ms 5383 ms 1.05
lotsOfClasses-componentSetCreate-win32 1257 ms 1291 ms 0.97
lotsOfClasses-sourceToMdapi-win32 7735 ms 7537 ms 1.03
lotsOfClasses-sourceToZip-win32 4973 ms 4668 ms 1.07
lotsOfClasses-mdapiToSource-win32 7778 ms 7460 ms 1.04
lotsOfClassesOneDir-componentSetCreate-win32 2180 ms 2113 ms 1.03
lotsOfClassesOneDir-sourceToMdapi-win32 13866 ms 13166 ms 1.05
lotsOfClassesOneDir-sourceToZip-win32 8692 ms 8342 ms 1.04
lotsOfClassesOneDir-mdapiToSource-win32 14040 ms 13285 ms 1.06

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

Please sign in to comment.