mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
chore: CommitID
This commit is contained in:
parent
2198439184
commit
e5aa1531a6
1 changed files with 14 additions and 38 deletions
50
src/main.ts
50
src/main.ts
|
|
@ -119,46 +119,22 @@ class TestReporter {
|
||||||
const results: TestRunResult[] = []
|
const results: TestRunResult[] = []
|
||||||
const input = await inputProvider.load()
|
const input = await inputProvider.load()
|
||||||
|
|
||||||
let version: string | null = null
|
|
||||||
|
|
||||||
if (input.versionArtifactPath) {
|
try {
|
||||||
try {
|
const readStream = input.trxZip.toBuffer();
|
||||||
core.info(`exists 1: ${fs.existsSync('src/EVA.TestSuite.Core/bin/Release/version.txt')}`);
|
const version = fs.existsSync('src/EVA.TestSuite.Core/bin/Release/version.txt') ? fs.readFileSync('src/EVA.TestSuite.Core/bin/Release/version.txt').toString() : null;
|
||||||
core.info(`exists 2: ${fs.existsSync('/src/EVA.TestSuite.Core/bin/Release/version.txt')}`);
|
const commitID = fs.existsSync('src/EVA.TestSuite.Core/bin/Release/commit.txt') ? fs.readFileSync('src/EVA.TestSuite.Core/bin/Release/commit.txt').toString() : null;
|
||||||
try {
|
|
||||||
core.info(`current dir ${__dirname}`);
|
|
||||||
}
|
|
||||||
catch (error: any) {
|
|
||||||
core.info("couldnt get current dir");
|
|
||||||
}
|
|
||||||
core.info('src exists ' + fs.existsSync('src'));
|
|
||||||
|
|
||||||
fs.readdirSync('./').map(x => {
|
core.info(`Using EVA version ${version}, commit ${commitID}, current directory: ${cwd()}`)
|
||||||
core.info('file: ' + x);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
const post = bent(this.resultsEndpoint, 'POST', {}, 200)
|
||||||
catch (error: any) {
|
await post(
|
||||||
core.warning("couldnt do debug stuff" + error);
|
`TestResults?Secret=${this.resultsEndpointSecret}${version ? '&EVAVersion=' + version : ''}${commitID ? '&EVACommitID=' + commitID : ''}`,
|
||||||
}
|
readStream
|
||||||
|
)
|
||||||
const version = fs.readFileSync('src/EVA.TestSuite.Core/bin/Release/version.txt').toString();
|
core.info(`Uploaded TRX files`)
|
||||||
core.info(`Using EVA version ${version}, current directory: ${cwd()}`)
|
} catch (ex) {
|
||||||
}
|
core.warning(`Could not upload TRX ZIP file: ${ex}`)
|
||||||
|
|
||||||
for (const a of input.artifactFilePaths) {
|
|
||||||
const readStream = fs.createReadStream(a)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const post = bent(this.resultsEndpoint, 'POST', {}, 200)
|
|
||||||
await post(
|
|
||||||
`TestResults?Secret=${this.resultsEndpointSecret}${version ? '&EVAVersion=' + version : ''}`,
|
|
||||||
readStream
|
|
||||||
)
|
|
||||||
core.info(`Uploaded TRX files: ${a}`)
|
|
||||||
} catch (ex) {
|
|
||||||
core.warning(`Could not upload file ${a}: ${ex}`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const [reportName, files] of Object.entries(input.reports)) {
|
for (const [reportName, files] of Object.entries(input.reports)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue