js-waku/ci/mergeAllureResults.cjs
Florin Barbu 80a33b9c2b
chore: allure test reporting (#1668)
* allure test reporting

* make reports only for the main job

* fail a test for demo

* fail a test for demo

* revert

* fail a test for demo

* revert

* deploy to allure-jswaku

* use PAT

* add pat as secret

* check if pat exists

* debug secrets issue

* remove debug steps

* debug1

* debug2

* debug3

* debug4

* set reports for all tests

* fix after ci run

* self review

---------

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
2023-10-23 17:53:56 +03:00

20 lines
564 B
JavaScript

const fs = require("fs-extra");
const glob = require("glob");
const ROOT_ALLURE_RESULTS = "./allure-results"; // Target directory in the root
fs.ensureDirSync(ROOT_ALLURE_RESULTS);
const directories = glob.sync("packages/**/allure-results");
directories.forEach((dir) => {
const files = fs.readdirSync(dir);
files.forEach((file) => {
const sourcePath = `${dir}/${file}`;
const targetPath = `${ROOT_ALLURE_RESULTS}/${file}`;
fs.copyFileSync(sourcePath, targetPath);
});
});
console.log("All allure-results directories merged successfully!");