Using Node.js Agents - Uploading multiple files
When uploading report files to the SeaLights server, you might need to upload multiple files rather than only one.
This can be done by either provide a folder where all the files existing in it will be uploaded or alternatively upload every single file in a command line loop.
See 'Generating an Agent token' for instructions on how to generate a token
Upload multiple report files in a folder
Sample command
Unix:
npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFilesFolder "/path/to/reports/"
Windows:
call npx slnodejs uploadReports --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFilesFolder "\path\to\reports\"
All the files in the specified folder will be uploaded regardless of their extension
Upload multiple report files using a command line loop
Sample commands - Unix
for f in /path/to/junit_report_*.xml
do
npx slnodejs uploadReports --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --reportFile "$f"
done
Sample commands - Windows
for /r %i in (.\tests\Test*.xml) do npx slnodejs uploadReports --tokenfile .\path\to\sltoken.txt --buildsessionidfile buildSessionId --reportFile %f
See 'Node.js Command Reference - Upload report files' for full parameter details