-
Notifications
You must be signed in to change notification settings - Fork 976
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add a test-result folder in backend and upload to JFrog to help …
…debug stream count issues.
- Loading branch information
1 parent
b5f6b59
commit 8a66e8b
Showing
4 changed files
with
23 additions
and
0 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
17 changes: 17 additions & 0 deletions
17
opencti-platform/opencti-graphql/tests/utils/testOutput.ts
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,17 @@ | ||
import fs from 'node:fs'; | ||
import { join } from 'node:path'; | ||
|
||
const TEST_OUTPUT_FOLDER = 'test-results'; | ||
|
||
/** | ||
* Write content to a folder that will be archived at the end of test in CI. | ||
* @param fileContent | ||
* @param filename | ||
*/ | ||
export const writeTestDataToFile = (fileContent: string, filename: string) => { | ||
if (!fs.existsSync(TEST_OUTPUT_FOLDER)) { | ||
fs.mkdirSync(TEST_OUTPUT_FOLDER, { recursive: true }); | ||
} | ||
const filePath = join(TEST_OUTPUT_FOLDER, filename); | ||
fs.writeFileSync(filePath, fileContent, {}); | ||
}; |