You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a transitional directory to copy zap reports thus changing
user:group ownership of report files, directories and support files.
We then recursivly update permissions in order to be able to traverse
the nested directories and modify markup and styling.
The orchestrator is thus able to traverse the report files and
directories and also able to delete.
The cloud instances periodically run a cron job to modify the
user:group of the report files, directories and support files in
order for us to attempt to delete immediately before we request zap
generate reports.
constreportFileAndDirNames=fileAndDirNames.filter((f)=>f.startsWith(`${this.#reportPrefix}appScannerId-${testSessionId}_`));// Only delete what we are responsible for.
// Cron job defined in userData.tpl sets ownership on everything in this dir so that this process running as user app_scanner is able to delete old files.
constadminSuccessText=`Attempt to delete TestSession specific ("${testSessionId}") files and dirs from App Tester upload directory: "${appTesterUploadDir}" ✔ succeeded ✔.`;
constadminErrorText=`Attempt to delete TestSession specific ("${testSessionId}") files and dirs from App Tester upload directory: "${appTesterUploadDir}" ✖ failed ✖. This is probably because the machine instance's cron job to set write permissions has not yet run for these files, Error was: ${err.message}`;
// Styling colours copied from https://purpleteam-labs.com/pricing/
282
297
styling: {
283
298
markupReplacements: [{
@@ -892,7 +907,7 @@ class Standard extends Reporting {
892
907
893
908
this.publisher.pubLog({ testSessionId,logLevel: 'info',textData: `The ${methodName}() method of the ${super.constructor.name} strategy "${this.constructor.name}" has been invoked.`,tagObj: {tags: [`pid-${process.pid}`,this.#fileName,methodName]}});
awaitPromise.all(reportFileAndDirNames.map(async(r)=>fsPromises.cp(`${appTesterUploadDir}${r}`,`${this.#emissaryOutputTransitionDir}${r}`,{preserveTimestamps: true,recursive: true})))// cp is experimental in node v17.
936
+
.catch((err)=>{
937
+
constbuildUserErrorText=`Error occurred while attempting to copy reports: "${reportFileAndDirNames}" from App Tester upload directory: "${appTesterUploadDir}" to Emissary output transition directory: "${this.#emissaryOutputTransitionDir}"`;
938
+
constadminErrorText=`${buildUserErrorText}, for Test Session with id: "${testSessionId}", Error was: ${err.message}`;
awaitPromise.all(reportFileAndDirNames.map(async(r)=>fsPromises.cp(`${appTesterUploadDir}${r}`,`${reportDir}${r}`,{preserveTimestamps: true,recursive: true})))// cp is experimental in node v17.
958
+
awaitPromise.all(reportFileAndDirNames.map(async(r)=>fsPromises.cp(`${this.#emissaryOutputTransitionDir}${r}`,`${reportDir}${r}`,{preserveTimestamps: true,recursive: true})))// cp is experimental in node v17.
924
959
.catch((err)=>{
925
-
constbuildUserErrorText=`Error occurred while attempting to copy reports: "${reportFileAndDirNames}" from App Tester upload directory: "${appTesterUploadDir}" to report directory: "${reportDir}"`;
960
+
constbuildUserErrorText=`Error occurred while attempting to copy reports: "${reportFileAndDirNames}" from Emissary output transition directory: "${this.#emissaryOutputTransitionDir}" to report directory: "${reportDir}"`;
926
961
constadminErrorText=`${buildUserErrorText}, for Test Session with id: "${testSessionId}", Error was: ${err.message}`;
constbuildUserErrorText=`Error occurred while attempting to remove reports: "${reportFileAndDirNames}" from App Tester upload directory: "${appTesterUploadDir}"`;
968
+
constbuildUserErrorText=`Error occurred while attempting to remove reports: "${reportFileAndDirNames}" from Emissary output transition directory: "${this.#emissaryOutputTransitionDir}"`;
934
969
constadminErrorText=`${buildUserErrorText}, for Test Session with id: "${testSessionId}", Error was: ${err.message}`;
0 commit comments