Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge development into master for Release 0.3.1 #35

Merged
merged 19 commits into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a660e66
PRO-16810: ProvarDX Incorrect Help messages (#23)
riteshnahar Aug 4, 2020
609db17
PRO-16923: ProvarDX runtests fails to handle special characters in Sc…
riteshnahar Aug 28, 2020
1d25b10
PRO-16890 : Enforce required flags for provar:metadatacache (#26)
Aug 28, 2020
679ed69
PRO-17213: ProvarDX 0.3.0 release (#27)
riteshnahar Sep 11, 2020
a9c8fd8
Merge branch 'master' into development
ProvarTesting Sep 11, 2020
f16982b
PRO-17244: Added Edge_Chromium WebBrowser for Dx Property Schema
VivekSaxena Sep 15, 2020
41ab649
Merge branch 'development' into PRO-17244
VivekSaxena Sep 17, 2020
54a47cd
PRO-17244: Version Changes
VivekSaxena Sep 17, 2020
cb91135
Merge pull request #30 from ProvarTesting/PRO-17244
sharad-provar Sep 17, 2020
5cd36a7
Added info to CHANGELOG.md (#31)
VivekSaxena Sep 21, 2020
028ade9
PRO-14366: Updated schema for new logging style for testOutputLevel (…
VivekSaxena Oct 16, 2020
5926c9e
PRO-17489: Removed testOutputLevel enum from schema file
VivekSaxena Oct 19, 2020
9874786
Renamed "Removed" to "removed"
VivekSaxena Oct 19, 2020
ed3d22c
Merge pull request #33 from ProvarTesting/PRO-17489A
sharad-provar Oct 19, 2020
121affa
PRO-17256: Update enum values for webBrowser
VivekSaxena Oct 22, 2020
a05581c
PRO-17256: Updated Edge_Chromium value to Edge_Legacy
VivekSaxena Oct 22, 2020
05178b1
Merge pull request #34 from ProvarTesting/PRO-17256
sharad-provar Oct 26, 2020
7d412bf
PRO-17689: Updated date in CHANGELOG.md for release 0.3.1 (#36)
riteshnahar Nov 20, 2020
fcc1dec
Merge branch 'master' into development
ProvarTesting Nov 20, 2020
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
node_modules
/.circleci
/.sfdx
/.vscode
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Attach to Remote",
"address": "127.0.0.1",
"port": 9229
},
{
"name": "Unit Tests",
"type": "node",
"request": "launch",
"protocol": "inspector",
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
"args": [
"--require",
"test/helpers/init.js",
"--require",
"ts-node/register",
"--require",
"source-map-support/register",
"--recursive",
"--reporter",
"spec",
"test/**/*.test.ts"
],
"cwd": "${workspaceRoot}"
}
]
}
15 changes: 15 additions & 0 deletions .vscode/provardx-copyright.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Insert Copyright Header": {
"prefix": "copyright",
"body": [
"/*",
" * Copyright (c) 2020 Make Positive Provar Ltd",
" * All rights reserved.",
" * Licensed under the BSD 3-Clause license.",
" * For full license text, see LICENSE.md file in the repo root or https://opensource.org/licenses/BSD-3-Clause",
" */",
"$0"
],
"description": "Insert the Provar copyright header"
}
}
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.3.1] - 2020-11-20

### Added

- Support for Edge Chromium
- Updated Enum for testOutputLevel and removed from schema to ignore validation
- Update Enum values for webBrowser

## [0.3.0] - 2020-09-11

### Fixed

- ProvarDX runtests, metadatacache command fails in case we are having special characters in Scratch Org password
- Enforced the required flags for ProvarDX metadatacache command
- Fixed the working of flags for ProvarDX metadatacache command in tandem

### Changed

- ProvarDX trademark changes
- Updated help messages for runtests

### Added

- Added .vscode folder containing
- `launch.json`: debug configuration for vscode
- `provardx-copyright.code-snippets`: used to add copyright tag on source files

## [0.2.2] - 2020-08-04

### Changed
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# provartesting/provardx
# ProvarDX™

ProvarDX is a Salesforce CLI Plugin for existing Provar customer to allow them to execute Provar Test Cases from the command line, leveraging the Salesforce CLI and SalesforceDX applications. This provides an alternative mechanism for running test cases than running under ANT.
ProvarDX is a Salesforce CLI Plugin for existing Provar customer to allow them to execute Provar Test Cases from the command line, leveraging the Salesforce CLI and SalesforceDX applications. This provides an alternative mechanism for running test cases than running under ANT.
You must be a Provar customer with a valid paid license to write and maintain your test cases.

[![Version](https://img.shields.io/npm/v/@provartesting/provardx.svg)](https://npmjs.org/package/@provartesting/provardx)
Expand Down Expand Up @@ -126,7 +126,7 @@ OPTIONS
must be in JSON format and conform to the provardx-properties
JSON schema.

-s, --secrets=secrets Specify path to secrets file
-s, --secrets=secrets Specify a secrets encryption key for accessing the chosen project/environment.

--json format output as json

Expand Down
2 changes: 1 addition & 1 deletion messages/runtests.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"connectionOverridefile": "Connection file in the format provardx-connection-schema.json providing a mapping between the Provar project Connection names and the target users to be used.",
"cachePathFlagDescription": "Specify relative or full file path for where a metadata cache has already been downloaded using either a VCS extract or metadata ProvarDX command.",
"metadataLevelFlagDescription": "Specify permitted values reload (get all metadata - default) | refresh (only download changes). This overrides any settings made in the propertyfile.",
"secretsFlagDescription": "Specify path to secrets file",
"secretsFlagDescription": "Specify a secrets encryption key for accessing the chosen project/environment.",
"loglevelFlagDescription": "Specify the level of feedback provided during the compilation (see above) and execution."
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@provartesting/provardx",
"description": "A plugin for the Salesforce CLI to run provar testcases",
"version": "0.2.2",
"version": "0.3.1",
"author": "Provar",
"bugs": "https://github.com/ProvarTesting/provardx/issues",
"dependencies": {
Expand Down
65 changes: 48 additions & 17 deletions src/commands/provar/metadatacache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@ export default class MetadataCache extends SfdxCommand {
const connections: string = this.flags.connections;
const connectionoverrides: string = this.flags.connectionoverrides;

if (
!metadataLevel || !cachePath
) {
this.ux.error(
"ERROR running provar:metadatacache : Please specify a cachepath and metadatalevel"
);
return {};
}

if (!["Reload", "Refresh", "Reuse"].includes(metadataLevel)) {
this.ux.error(
"ERROR running provar:metadatacache : Please specify a valid metadata level(-m flag). Valid levels are : 'Reuse', 'Refresh' and 'Reload'"
);
return {};
}

const provarDxUtils: ProvarDXUtility = new ProvarDXUtility();
const isValid: boolean = provarDxUtils.validatePropertiesJson(
propertyFile
Expand All @@ -96,7 +112,7 @@ export default class MetadataCache extends SfdxCommand {
provarDxUtils.hasDuplicateConnectionOverride(propertiesInstance)
) {
this.ux.error(
"Invalid property file. Run command sfdx provar:validate' to know the validation errors"
"ERROR running provar:metadatacache : Please specify a valid property file. Run command sfdx provar:validate' to know the validation errors"
);
return {};
}
Expand All @@ -117,26 +133,26 @@ export default class MetadataCache extends SfdxCommand {
const userInfo = await provarDxUtils.getDxUsersInfo(
properties.connectionOverride
);
if (userInfo == null) {
if (userInfo === null && !connections) {
this.ux.error(
'[ERROR] No valid user org found to download metadata. Terminating command.'
);
return {};
}

const userInfoString = provarDxUtils.prepareRawProperties(
const userInfoString = connections && userInfo === null ? "NA" : provarDxUtils.prepareRawProperties(
JSON.stringify({ dxUsers: userInfo })
);
const jarPath = properties.provarHome + '/provardx/provardx.jar';
execSync(
'java -cp "' +
jarPath +
'" com.provar.provardx.DxCommandExecuter ' +
updateProperties +
' ' +
userInfoString +
' ' +
'Metadata',
jarPath +
'" com.provar.provardx.DxCommandExecuter ' +
updateProperties +
' ' +
userInfoString +
' ' +
'Metadata',
{ stdio: 'inherit' }
);
return {};
Expand Down Expand Up @@ -167,15 +183,30 @@ export default class MetadataCache extends SfdxCommand {
properties: any,
connectionOverride: string
): void {
if (!connectionOverride) {
if (!connectionOverride && !properties.connectionName) {
return;
}
const overrides = connectionOverride.split(',');
const connOver = [];
for (const override of overrides) {
const v = override.split(':');
connOver.push({ connection: v[0], username: v[1] });

if (properties.connectionName && properties.connectionOverride) {
const overrides = properties.connectionName.split(',');
const connOver = [];
for (const override of properties.connectionOverride) {
if (overrides.indexOf(override.connection) !== -1) {
connOver.push(override);
}
}
properties.connectionOverride = connOver;
}

if (connectionOverride) {
const overrides = connectionOverride.split(',');
for (const override of overrides) {
const overrideDetails = override.split(':');
const prop = properties.connectionOverride.find(f => f.connection === overrideDetails[0]);
if(prop){
prop.username = overrideDetails[1];
}
}
}
properties.connectionOverride = connOver;
}
}
6 changes: 3 additions & 3 deletions src/utilities/DxPropertiesSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export const schema = {
testOutputLevel: {
description:
'Controls the amount of test output logged to the DX test log.',
type: 'string',
enum: ['SEVERE', 'WARNING', 'INFO', 'FINE', 'FINER', 'FINEST']
type: 'string'
},
pluginOutputlevel: {
description:
Expand Down Expand Up @@ -98,9 +97,10 @@ export const schema = {
type: 'string',
enum: [
'Chrome',
'SAFARI',
'Edge',
'Edge_Legacy',
'Firefox',
'SAFARI',
'IE',
'Chrome_Headless'
]
Expand Down
4 changes: 1 addition & 3 deletions src/utilities/ProvarDXUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,7 @@ export default class ProvarDXUtility {

private handleSpecialCharacters(password: string): string {
if (password) {
password = password.split('&').join('"&"');
password = password.split('|').join('"|"');
password = password.split('^').join('"^"');
password = encodeURIComponent(password);
}
return password;
}
Expand Down