Skip to content

Commit

Permalink
fix: workaround compute log display issues (#1151)
Browse files Browse the repository at this point in the history
Simple workaround to introduce a newline at the end of the postamble to ensure that the last bit of log displays properly in the given error scenario. We'll be following up internally with the compute api team to understand why this is required.
  • Loading branch information
smorrisj authored Aug 19, 2024
1 parent d667a9c commit 4baf81c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion client/src/components/utils/SASCodeDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ export class SASCodeDocument {
ods graphics on;
ods html5(id=vscode)${htmlStyleOption} options(bitmap_mode='inline' svg_mode='inline')${outputDestination};
${code}
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;
} else {
return code;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/connection/rest/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class ComputeJob extends Compute {
timeout: timeout,
});

//To clear out the log, we yeild all lines until there is not "next" link
//To clear out the log, we yield all lines until there is not "next" link
do {
if (resp.status === 200) {
nextLink = resp.data.links?.find((link) => link.rel === "next");
Expand Down
18 changes: 12 additions & 6 deletions client/test/components/util/SASCodeDocument.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ python code
selected python code
endsubmit;
run;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(sasCodeDoc.getWrappedCode(), expected);
});
Expand All @@ -55,7 +56,8 @@ ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inl
proc sql;
SELECT * FROM issues WHERE issue.developer = 'scnjdl'
;quit;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(sasCodeDoc.getWrappedCode(), expected);
});
Expand Down Expand Up @@ -84,7 +86,8 @@ ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inl
proc sgplot data=sashelp.class;
histogram age;
run;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(sasCodeDoc.getWrappedCode(), expected);
});
Expand All @@ -108,7 +111,8 @@ ods graphics on;
ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inline') body="519058ad-d33b-4b5c-9d23-4cc8d6ffb163.htm";
%let _SASPROGRAMFILE = %nrquote(%nrstr(c:\\temp\\My Test\\R&D\\mean%(95%CI%)\\Parkinson%'s Disease example.sas));
%put &=_SASPROGRAMFILE;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(
sasCodeDoc.getWrappedCode(),
Expand Down Expand Up @@ -136,7 +140,8 @@ ods graphics on;
ods html5(id=vscode) style=Illuminate options(bitmap_mode='inline' svg_mode='inline') body="519058ad-d33b-4b5c-9d23-4cc8d6ffb163.htm";
%let _SASPROGRAMFILE = %nrquote(%nrstr(/tmp/My Test/R&D/mean%(95%CI%)/Parkinson%'s Disease example.sas));
%put &=_SASPROGRAMFILE;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(
sasCodeDoc.getWrappedCode(),
Expand Down Expand Up @@ -171,7 +176,8 @@ cas; caslib _all_ assign;
data casuser.cascars; set sashelp.cars; run;
proc casutil; load data=SASHELP.BASEBALL outcaslib="CASUSER" casout="CASBALL";run;
;*';*";*/;run;quit;ods html5(id=vscode) close;`;
;*';*";*/;run;quit;ods html5(id=vscode) close;
`;

assert.equal(
sasCodeDoc.getWrappedCode(),
Expand Down

0 comments on commit 4baf81c

Please sign in to comment.