1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-03 15:40:05 +00:00

Merge pull request #162 from sasjs/mf_getapploc

fix: adding support for testsetup and testteardown in mf_getapploc.sas
This commit is contained in:
Allan Bowe
2022-02-05 22:56:10 +02:00
committed by GitHub
6 changed files with 49 additions and 6 deletions

View File

@@ -352,6 +352,7 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex
@li /data
@li /jobs
@li /services
@li /tests
@li /tests/jobs
@li /tests/services
@li /tests/macros
@@ -383,9 +384,13 @@ https://github.com/yabwon/SAS_PACKAGES/blob/main/packages/baseplus.md#functionex
/**
* First check we are not in the tests/macros folder (which has no subfolders)
* or specifically in the testsetup or testteardown services
*/
%if %index(&pgm,/tests/macros/) %then %do;
%let root=%substr(&pgm,1,%index(&pgm,/tests/macros)-1);
%if %index(&pgm,/tests/macros/)
or %index(&pgm,/tests/testsetup)
or %index(&pgm,/tests/testteardown)
%then %do;
%let root=%substr(&pgm,1,%index(&pgm,/tests)-1);
&root
%return;
%end;

View File

@@ -15,6 +15,7 @@
@li /data
@li /jobs
@li /services
@li /tests
@li /tests/jobs
@li /tests/services
@li /tests/macros
@@ -46,9 +47,13 @@
/**
* First check we are not in the tests/macros folder (which has no subfolders)
* or specifically in the testsetup or testteardown services
*/
%if %index(&pgm,/tests/macros/) %then %do;
%let root=%substr(&pgm,1,%index(&pgm,/tests/macros)-1);
%if %index(&pgm,/tests/macros/)
or %index(&pgm,/tests/testsetup)
or %index(&pgm,/tests/testteardown)
%then %do;
%let root=%substr(&pgm,1,%index(&pgm,/tests)-1);
&root
%return;
%end;

15
package-lock.json generated
View File

@@ -7,7 +7,8 @@
"name": "@sasjs/core",
"license": "MIT",
"devDependencies": {
"@sasjs/cli": "3.6.0"
"@sasjs/cli": "3.6.0",
"@sasjs/core": "4.4.4"
}
},
"node_modules/@sasjs/adapter": {
@@ -108,6 +109,12 @@
"valid-url": "^1.0.9"
}
},
"node_modules/@sasjs/core": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.4.4.tgz",
"integrity": "sha512-gN6d0fvhaofp7buemS5KIOo5Bz8lbqhsEQD7SuH5FZ02MQurmfu7A0Zg0lIEi0w2/ptI4M/sZdF4D2DRh1D5xA==",
"dev": true
},
"node_modules/@sasjs/lint": {
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/@sasjs/lint/-/lint-1.11.2.tgz",
@@ -2822,6 +2829,12 @@
}
}
},
"@sasjs/core": {
"version": "4.4.4",
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-4.4.4.tgz",
"integrity": "sha512-gN6d0fvhaofp7buemS5KIOo5Bz8lbqhsEQD7SuH5FZ02MQurmfu7A0Zg0lIEi0w2/ptI4M/sZdF4D2DRh1D5xA==",
"dev": true
},
"@sasjs/lint": {
"version": "1.11.2",
"resolved": "https://registry.npmjs.org/@sasjs/lint/-/lint-1.11.2.tgz",

View File

@@ -33,6 +33,7 @@
"prepare": "git rev-parse --git-dir && git config core.hooksPath ./.git-hooks || true"
},
"devDependencies": {
"@sasjs/cli": "3.6.0"
"@sasjs/cli": "3.6.0",
"@sasjs/core": "4.4.4"
}
}

View File

@@ -46,4 +46,20 @@
),
desc=Checking tests/macros appLoc matches (which has no subfolder),
outds=work.test_results
)
%mp_assert(
iftrue=(
"%mf_getapploc(/some/area/tests/testsetup)"="/some/area"
),
desc=Checking tests/testsetup operation,
outds=work.test_results
)
%mp_assert(
iftrue=(
"%mf_getapploc(/some/area/tests/testteardown)"="/some/area"
),
desc=Checking tests/teardown operation,
outds=work.test_results
)

View File

@@ -76,3 +76,6 @@ run;
iftrue=(&syscc ne 0),
desc=Check that non zero return code is returned if called job fails
)
/* set syscc to zero for final check in testterm */
%let syscc=0;