Skip to content

Commit 6974e36

Browse files
committed
feat!: shorten command to atgd
1 parent f9050ba commit 6974e36

File tree

9 files changed

+18
-19
lines changed

9 files changed

+18
-19
lines changed

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ AccountTriggerHandlerTest OpportunityTriggerHandlerTest PrepareMySandboxTest Quo
3030

3131
The command's output is designed to be used with the Salesforce CLI (`sf`) deployment command. So when you want to deploy or validate Apex metadata, you can wrap this command with the deploy command to dynamically build the list of specified tests:
3232

33-
3433
```
35-
sf project deploy start -x package/package.xml -l RunSpecifiedTests -t $(sf apex-tests-git-delta delta --from "HEAD~1" --to "HEAD")
34+
sf project deploy start -x package/package.xml -l RunSpecifiedTests -t $(sf atgd delta --from "HEAD~1" --to "HEAD")
3635
```
3736

3837
**NOTE:** The test classes will only be added to the output if they are found in one of your package directories as listed in the `sfdx-project.json` in the `--to` commit's file-tree. If the test class name was not found in any package directory, a warning will be printed to the terminal. The plugin will not fail if no test classes are included in the final output. The output and text file will simply be empty if no delta test classes were found in any commit message or no test classes were validated against a package directory.
@@ -55,17 +54,17 @@ sf plugins install [email protected]
5554

5655
The `apex-tests-git-delta` has 1 command:
5756

58-
- `sf apex-tests-git-delta delta`
57+
- `sf atgd delta`
5958

6059
This command needs to be ran somewhere inside your Salesforce DX git repository, whether it's the root folder (recommended) or a subfolder.
6160

6261
This command will determine the root folder of the repo and look for the `sfdx-project.json` file in the root folder.
6362

64-
## `sf apex-tests-git-delta delta`
63+
## `sf atgd delta`
6564

6665
```
6766
USAGE
68-
$ sf apex-tests-git-delta delta -f <value> -t <value> [--json]
67+
$ sf atgd delta -f <value> -t <value> [--json]
6968
7069
FLAGS
7170
-f, --from=<value> Commit SHA from where the commit message log is done. This SHA's commit message will not be included in the results.
@@ -78,5 +77,5 @@ DESCRIPTION
7877
Given 2 git commits, this plugin will parse all of the commit messages between this range and return the delta Apex test class string. This can be used to execute delta deployments.
7978
8079
EXAMPLES
81-
$ sf apex-tests-git-delta delta --from "HEAD~1" --to "HEAD"
80+
$ sf atgd delta --from "HEAD~1" --to "HEAD"
8281
```

messages/delta.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Given 2 git commits, this plugin will parse all of the commit messages between t
88

99
# examples
1010

11-
- `sf apex-tests-git-delta delta --from "HEAD~1" --to "HEAD"`
11+
- `sf atgd delta --from "HEAD~1" --to "HEAD"`
1212

1313
# flags.from.summary
1414

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"bin": "sf",
4949
"topicSeparator": " ",
5050
"topics": {
51-
"apex-tests-git-delta": {
52-
"description": "description for apex-tests-git-delta"
51+
"atgd": {
52+
"description": "description for atgd"
5353
}
5454
},
5555
"devPlugins": [

test/commands/delta/delta.nut.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { expect } from 'chai';
88
import { createTemporaryCommit } from './createTemporaryCommit.js';
99
import { setupTestRepo } from './setupTestRepo.js';
1010

11-
describe('apex-tests-git-delta NUTs', () => {
11+
describe('atgd NUTs', () => {
1212
let session: TestSession;
1313
let tempDir: string;
1414
const originalDir = process.cwd();
@@ -40,7 +40,7 @@ describe('apex-tests-git-delta NUTs', () => {
4040
});
4141

4242
it('runs delta command and returns the tests.', async () => {
43-
const command = 'apex-tests-git-delta delta --from "HEAD~2" --to "HEAD"';
43+
const command = 'atgd delta --from "HEAD~2" --to "HEAD"';
4444
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
4545

4646
expect(output.replace('\n', '')).to.equal('SandboxTest TestClass3 TestClass4');

test/commands/delta/delta.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { rm } from 'node:fs/promises';
55
import { TestContext } from '@salesforce/core/lib/testSetup.js';
66
import { expect } from 'chai';
77
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
8-
import ApexTestDelta from '../../../src/commands/apex-tests-git-delta/delta.js';
8+
import ApexTestDelta from '../../../src/commands/atgd/delta.js';
99
import { createTemporaryCommit } from './createTemporaryCommit.js';
1010
import { setupTestRepo } from './setupTestRepo.js';
1111

12-
describe('return the delta tests between git commits', () => {
12+
describe('atgd unit test', () => {
1313
const $$ = new TestContext();
1414
let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;
1515
let tempDir: string;

test/commands/delta/empty.nut.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { expect } from 'chai';
88
import { createTemporaryCommit } from './createTemporaryCommit.js';
99
import { setupTestRepo } from './setupTestRepo.js';
1010

11-
describe('apex-tests-git-delta empty string NUT', () => {
11+
describe('atgd empty string NUT', () => {
1212
let session: TestSession;
1313
let fromSha: string;
1414
let toSha: string;
@@ -34,7 +34,7 @@ describe('apex-tests-git-delta empty string NUT', () => {
3434
});
3535

3636
it('runs delta command and returns no tests.', async () => {
37-
const command = `apex-tests-git-delta delta --from "${fromSha}" --to "${toSha}"`;
37+
const command = `atgd delta --from "${fromSha}" --to "${toSha}"`;
3838
const output = execCmd(command, { ensureExitCode: 0 }).shellOutput.stdout;
3939

4040
expect(output.replace('\n', '')).to.equal('');

test/commands/delta/empty.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { rm } from 'node:fs/promises';
55
import { TestContext } from '@salesforce/core/lib/testSetup.js';
66
import { expect } from 'chai';
77
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
8-
import ApexTestDelta from '../../../src/commands/apex-tests-git-delta/delta.js';
8+
import ApexTestDelta from '../../../src/commands/atgd/delta.js';
99
import { createTemporaryCommit } from './createTemporaryCommit.js';
1010
import { setupTestRepo } from './setupTestRepo.js';
1111

12-
describe('scan commit messages without the regex and return an empty string.', () => {
12+
describe('atgd unit test - empty string', () => {
1313
const $$ = new TestContext();
1414
let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;
1515
let fromSha: string;

test/commands/delta/warnings.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { rm } from 'node:fs/promises';
55
import { TestContext } from '@salesforce/core/lib/testSetup.js';
66
import { expect } from 'chai';
77
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
8-
import ApexTestDelta from '../../../src/commands/apex-tests-git-delta/delta.js';
8+
import ApexTestDelta from '../../../src/commands/atgd/delta.js';
99
import { createTemporaryCommit } from './createTemporaryCommit.js';
1010
import { setupTestRepo } from './setupTestRepo.js';
1111

12-
describe('confirm warnings are generated when files cannot be found in a package directory.', () => {
12+
describe('atgd unit test - warnings', () => {
1313
const $$ = new TestContext();
1414
let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;
1515
let fromSha: string;

0 commit comments

Comments
 (0)