Skip to content
Merged
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@salesforce/command": "^5.1.2",
"@salesforce/core": "^3.20.1",
"@salesforce/kit": "^1.5.41",
"@salesforce/source-deploy-retrieve": "^6.0.3",
"@salesforce/source-deploy-retrieve": "^6.0.4",
"@salesforce/source-tracking": "^2.0.0",
"chalk": "^4.1.2",
"got": "^11.8.3",
Expand Down
45 changes: 45 additions & 0 deletions test/nuts/mdapi.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,51 @@ const writeManifest = (manifestPath: string, contents?: string) => {
fs.writeFileSync(manifestPath, contents);
};

describe('1k files in mdapi:deploy', () => {
const classCount = 1000;

before(async () => {
session = await TestSession.create({
project: {
name: 'large-repo',
},
setupCommands: ['sfdx force:org:create -d 1 -s -f config/project-scratch-def.json'],
});
// create some number of files
const classdir = path.join(session.project.dir, 'force-app', 'main', 'default', 'classes');

for (let c = 0; c < classCount; c++) {
const className = `xx${c}`;
await Promise.all([
fs.promises.writeFile(
path.join(classdir, `${className}.cls`),
`public with sharing class ${className} {public ${className}() {}}`
),
fs.promises.writeFile(
path.join(classdir, `${className}.cls-meta.xml`),
'<?xml version="1.0" encoding="UTF-8"?><ApexClass xmlns="http://soap.sforce.com/2006/04/metadata"><apiVersion>54.0</apiVersion><status>Active</status></ApexClass>'
),
]);
}
});

after(async () => {
await session?.clean();
});

it('should be able to handle a mdapi:deploy of 1k', async () => {
execCmd('force:source:convert --outputdir mdapiFormat', { ensureExitCode: 0 });
const res = execCmd<{ checkOnly: boolean; done: boolean }>('force:mdapi:deploy -d mdapiFormat -w 100 --json', {
ensureExitCode: 0,
}).jsonOutput;
expect(res.status).to.equal(0);
// check that the deploy actually happened, not just based on the exit code, otherwise something like
// https://github.com/forcedotcom/cli/issues/1531 could happen
expect(res.result.checkOnly).to.be.false;
expect(res.result.done).to.be.true;
});
});

describe('mdapi NUTs', () => {
before(async () => {
session = await TestSession.create({
Expand Down
Loading