Skip to content

Commit

Permalink
chore: update convert, NUTs to use genUniqueDir: false (#88)
Browse files Browse the repository at this point in the history
* chore: update convert, NUTs to use genUniqueDir: false

* chore: add large executor to windows

* chore: add findAndMove manifest back

* chore: fix convert NUT output dir

* chore: try new approach
  • Loading branch information
WillieRuemmele authored May 27, 2021
1 parent 539de88 commit c52800e
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ workflows:
- release-management/test-nut:
name: nuts-on-linux
node_version: lts
size: large
sfdx_version: latest
requires:
- node-latest
- release-management/test-nut:
name: nuts-on-windows
sfdx_version: latest
size: large
node_version: lts
os: windows
requires:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@oclif/config": "^1",
"@salesforce/command": "^3.1.0",
"@salesforce/core": "^2.20.8",
"@salesforce/source-deploy-retrieve": "^2",
"@salesforce/source-deploy-retrieve": "^2.1.4",
"chalk": "^4.1.0",
"cli-ux": "^5.5.1",
"tslib": "^2"
Expand Down
1 change: 1 addition & 0 deletions src/commands/force/source/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export class Convert extends SourceCommand {
type: 'directory',
outputDirectory: this.getFlag<string>('outputdir'),
packageName: this.getFlag<string>('packagename'),
genUniqueDir: false,
});
}

Expand Down
20 changes: 6 additions & 14 deletions test/nuts/seeds/convert.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,13 @@ context('Convert NUTs [name: %REPO_NAME%] [exec: %EXECUTABLE%]', () => {
for (const testCase of REPO.convert.manifest) {
it(`should convert ${testCase.toConvert}`, async () => {
// Generate a package.xml by converting via sourcepath
const toConvert = path.normalize(testCase.toConvert);
await testkit.convert({
args: `--sourcepath ${toConvert} --outputdir out1`,
exitCode: 0,
});
const outputDir = path.join(process.cwd(), 'out1');
testkit.findAndMoveManifest(outputDir);
const packageXml = path.join(process.cwd(), 'package.xml');

const res = await testkit.convert({ args: `--manifest ${packageXml} --outputdir out2`, exitCode: 0 });
await testkit.convert({ args: `--sourcepath ${testCase.toConvert} --outputdir out1` });
const packageXml = path.join('out1', 'package.xml');

convertDir = path.relative(process.cwd(), asString(res.result?.location));
await testkit.expect.directoryToHaveSomeFiles(convertDir);
await testkit.expect.fileToExist(path.join(convertDir, 'package.xml'));
await testkit.expect.filesToBeConverted(convertDir, testCase.toVerify);
await testkit.convert({ args: `--manifest ${packageXml} --outputdir out2` });
await testkit.expect.directoryToHaveSomeFiles('out2');
await testkit.expect.fileToExist(path.join('out2', 'package.xml'));
await testkit.expect.filesToBeConverted('out2', testCase.toVerify);
});

afterEach(() => {
Expand Down
7 changes: 2 additions & 5 deletions test/nuts/seeds/deploy.manifest.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ context('Deploy manifest NUTs [name: %REPO_NAME%] [exec: %EXECUTABLE%]', () => {
for (const testCase of REPO.deploy.manifest) {
const toDeploy = path.normalize(testCase.toDeploy);
it(`should deploy ${toDeploy}`, async () => {
// generate package.xml to use with the --manifest param
await testkit.convert({ args: `--sourcepath ${toDeploy} --outputdir out` });
const outputDir = path.join(process.cwd(), 'out');
testkit.findAndMoveManifest(outputDir);
const packageXml = path.join(process.cwd(), 'package.xml');
await testkit.convert({ args: `--sourcepath ${testCase.toDeploy} --outputdir out` });
const packageXml = path.join('out', 'package.xml');

await testkit.deploy({ args: `--manifest ${packageXml}` });
await testkit.expect.filesToBeDeployed(testCase.toVerify);
Expand Down
6 changes: 2 additions & 4 deletions test/nuts/seeds/retrieve.manifest.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ context('Retrieve manifest NUTs [name: %REPO_NAME%] [exec: %EXECUTABLE%]', () =>
const toRetrieve = path.normalize(testCase.toRetrieve);
it(`should retrieve ${toRetrieve}`, async () => {
// generate package.xml to use with the --manifest param
await testkit.convert({ args: `--sourcepath ${toRetrieve} --outputdir out` });
const outputDir = path.join(process.cwd(), 'out');
testkit.findAndMoveManifest(outputDir);
const packageXml = path.join(process.cwd(), 'package.xml');
await testkit.convert({ args: `--sourcepath ${testCase.toRetrieve} --outputdir out` });
const packageXml = path.join('out', 'package.xml');

await testkit.modifyLocalGlobs(testCase.toVerify);
await testkit.retrieve({ args: `--manifest ${packageXml}` });
Expand Down
18 changes: 17 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@
resolved "https://registry.yarnpkg.com/@salesforce/schemas/-/schemas-1.1.0.tgz#bbf94a11ee036f2b0ec6ba82306cd9565a6ba26b"
integrity sha512-6D7DvE6nFxpLyyTnrOIbbAeCJw2r/EpinFAcMh6gU0gA/CGfSbwV/8uR3uHLYL2zCyCZLH8jJ4dZ3BzCMqc+Eg==

"@salesforce/source-deploy-retrieve@^2", "@salesforce/source-deploy-retrieve@^2.1.3":
"@salesforce/source-deploy-retrieve@^2.1.3":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-2.1.3.tgz#24dc96f0fa4f24cdf827c98078da1c1315219665"
integrity sha512-Dkv+vkHAxr8eYVUyLechZDpIcHjfoBNGuBpFsERaGxqA63OmTzV8ZxoPwd52PyBOAsrxRGISd7NuE+NmS04WXw==
Expand All @@ -762,6 +762,22 @@
unzipper "0.10.11"
xmldom-sfdx-encoding "^0.1.29"

"@salesforce/source-deploy-retrieve@^2.1.4":
version "2.1.4"
resolved "https://registry.yarnpkg.com/@salesforce/source-deploy-retrieve/-/source-deploy-retrieve-2.1.4.tgz#0d99aeea6a3d825dc7b101d4b2bd38e9498fa3a3"
integrity sha512-DczxXGUq0Qv4ZXgy3FBXeMlyW+ql8Ou7Kz+vAU22mdE53ES6T9RGcx0gb+qVR24J2tTxUYzMMf5ezXbg4zGb3g==
dependencies:
"@salesforce/core" "2.13.0"
"@salesforce/kit" "1.5.0"
"@salesforce/ts-types" "^1.4.2"
archiver "4.0.1"
fast-xml-parser "^3.17.4"
gitignore-parser "0.0.2"
ignore "^5.1.8"
mime "2.4.6"
unzipper "0.10.11"
xmldom-sfdx-encoding "^0.1.29"

"@salesforce/source-testkit@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@salesforce/source-testkit/-/source-testkit-0.0.5.tgz#9f9a83be85cbfbbf1fdf0bd3a5298d9391e2740f"
Expand Down

0 comments on commit c52800e

Please sign in to comment.