-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from ChuckJonas/ralphcallaway-test_methods
Ralphcallaway test methods
- Loading branch information
Showing
299 changed files
with
1,407 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"cSpell.words": [ | ||
"Devhub", | ||
"Integ", | ||
"commandsstop", | ||
"gitpackage", | ||
"globby", | ||
"ignorewhitespace", | ||
"jsdiff", | ||
"loglevel", | ||
"nodelete", | ||
"notgit", | ||
"oclif", | ||
"outputdir", | ||
"postpack", | ||
"posttest", | ||
"shrinkwrap", | ||
"sourceref", | ||
"staticresources", | ||
"stdo", | ||
"targetref", | ||
"tslib" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('test suite', () => { | ||
it('will have some tests in the future', () => { | ||
console.log('but not yet'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { getIntegBranches, myExec, projectPath } from './util'; | ||
|
||
(async () => { | ||
try { | ||
for (const branch of await getIntegBranches()) { | ||
console.log(`generating ${branch}`); | ||
await myExec( | ||
`sfdx git:package -s ${branch} -t master -d "../output/${branch}" --purge`, | ||
projectPath); | ||
} | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
})() | ||
.then(() => console.log('done')) | ||
.catch(e => console.log(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import * as assert from 'assert'; | ||
import { compareSync } from 'dir-compare'; | ||
import { myExec, projectPath, setGitENV } from './util'; | ||
|
||
async function runTest(testName: string) { | ||
const sourceRef = testName; | ||
const expectedOutputDir = testName; | ||
try { | ||
const res = await myExec( | ||
`sfdx git:package -d deploy --purge -s ${sourceRef} -t master`, | ||
projectPath); | ||
assert.equal(null, res.err); | ||
const compareRes = compareSync('test/integration/project/deploy', `test/integration/output/${expectedOutputDir}`, { compareContent: true }); | ||
const mismatched = compareRes.diffSet.filter(diff => diff.state !== 'equal').map(diff => diff.name1 || diff.name2); | ||
assert.strictEqual(mismatched.length, 0, `The following files were different: \n${mismatched.join('\n')}`); | ||
assert.strictEqual(true, compareRes.equal > 0); | ||
} catch (e) { | ||
assert.fail(e); | ||
} | ||
} | ||
|
||
describe('git:package integration test', async () => { | ||
before(async () => { | ||
setGitENV(); | ||
await myExec('git checkout master', projectPath); | ||
await myExec('git reset --hard', projectPath); | ||
}); | ||
|
||
describe('apex classes', async () => { | ||
it('detects a new apex class', async () => { | ||
await runTest('add_class'); | ||
}); | ||
it('detects an update to an apex class', async () => { | ||
await runTest('mod_class'); | ||
}); | ||
it('detects an update to an apex class meta file', async () => { | ||
await runTest('mod_class_meta'); | ||
}); | ||
it('detects deletion of an apex class', async () => { | ||
await runTest('del_class'); | ||
}); | ||
}); | ||
|
||
describe('custom fields', async () => { | ||
it('detects a new custom field', async () => { | ||
await runTest('add_field'); | ||
}); | ||
it('detects an update to an custom field', async () => { | ||
await runTest('mod_field'); | ||
}); | ||
it('detects deletion of an custom field', async () => { | ||
await runTest('del_field'); | ||
}); | ||
}); | ||
|
||
describe('custom objects', async () => { | ||
it('detects a new custom object', async () => { | ||
await runTest('add_object'); | ||
}); | ||
it('detects an update to an custom object', async () => { | ||
await runTest('mod_object'); | ||
}); | ||
it('detects deletion of an custom object', async () => { | ||
await runTest('del_object'); | ||
}); | ||
}); | ||
|
||
describe('static resources', async () => { | ||
it('detects a new static resource', async () => { | ||
await runTest('add_static_resource'); | ||
}); | ||
it('detects an update to a static resource', async () => { | ||
await runTest('mod_static_resource'); | ||
}); | ||
it('detects full deletion of a static resource', async () => { | ||
await runTest('del_static_resource'); | ||
}); | ||
}); | ||
|
||
describe('folder_types', async () => { | ||
it('detects partial deletion of a folder', async () => { | ||
await runTest('del_single_file_from_folder'); | ||
}); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public with sharing class Example2 { | ||
public Example2() { | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
test/integration/output/add_class/classes/Example2.cls-meta.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ApexClass xmlns="urn:metadata.tooling.soap.sforce.com" fqn="Example2"> | ||
<apiVersion>47.0</apiVersion> | ||
<status>Active</status> | ||
</ApexClass> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Package xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<types> | ||
<name>ApexClass</name> | ||
<members>Example2</members> | ||
</types> | ||
<version>45.0</version> | ||
</Package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> | ||
<fields> | ||
<fullName>A_Date__c</fullName> | ||
<externalId>false</externalId> | ||
<label>A Date</label> | ||
<required>false</required> | ||
<trackTrending>false</trackTrending> | ||
<type>Date</type> | ||
</fields> | ||
</CustomObject> |
Oops, something went wrong.