remove the dependency patch when the JUnit root-layout fix is released:
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 73/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- github-actions, javascript, node.js
Research direction
Start with actions/quality/prepare-ci-reports/src/TestReports.js and inspect the junit-to-ctrf dependency and the linked root-layout fix, pull request 93. Check whether that fix has been released and how the dependency patch is applied; remove the patch once the release is available. Confirm the converter still handles JUnit reports and produces a valid, nonempty CTRF report.
Written by the indexing model from the issue text.
Description
https://github\.com/ctrf\-io/junit\-to\-ctrf/pull/93
import fs from "node:fs";
import { validate } from "ctrf";
import { XMLValidator } from "fast-xml-parser";
// FIXME: remove the dependency patch when the JUnit root-layout fix is released:
// https://github.com/ctrf-io/junit-to-ctrf/pull/93
import { convertJUnitToCTRFReport } from "junit-to-ctrf";
import { JestReport } from "./JestReport.js";
import { SourcePaths } from "./SourcePaths.js";
/** Adapt native runner output to the maintained CTRF converters and schema. */
export class TestReports {
constructor(options) {
this.options = options;
}
async convert(file, target) {
const options = { ...this.options, output: `${target}.json` };
const content = fs.readFileSync(file, "utf8");
let report;
if (content.trimStart().startsWith("<")) {
if (
/<!ENTITY|<!DOCTYPE/i.test(content) ||
XMLValidator.validate(content) !== true
)
throw new Error("Invalid or unsafe JUnit XML.");
report = await convertJUnitToCTRFReport(file, {
toolName: options.name,
log: false,
});
} else {
const value = JSON.parse(content);
report = value.results
? value
: await new JestReport(options).convert(value);
}
const result = validate(report);
if (!result.valid || !report?.results?.tests?.length)
throw new Error(
`Expected a nonempty valid test report: ${JSON.stringify(result.errors)}`,
);
for (const test of report.results.tests) {
const source = new SourcePaths(options).resolve(test.filePath);
if (source) test.filePath = source;
else delete test.filePath;
}
report.results.environment = {
...report.results.environment,
appName: options.project,
buildName: options.name,
};
report.results.extra = {
...report.results.extra,
variant: options.variant,
};
fs.writeFileSync(options.output, JSON.stringify(report));
return { file: options.output, summary: report.results.summary };
}
}
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 1
- Avg merge
- 5h 25m
- Merged PRs (30d)
- 60
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hoverkraft-tech/ci-github-common
-
bug need-fix
Difficulty 1/5 Under an hour Newbie friendliness 76/100
hoverkraft-tech/ci-github-common#691 ·
Maintainers usually reply within 1 day
-
bug need-fix
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
hoverkraft-tech/ci-github-common#690 ·
Maintainers usually reply within 1 day
-
bug need-fix
Difficulty 1/5 Under an hour Newbie friendliness 83/100
hoverkraft-tech/ci-github-common#688 ·
Maintainers usually reply within 1 day
-
bug need-fix
Difficulty 3/5 1-2 days Newbie friendliness 48/100
hoverkraft-tech/ci-github-common#695 ·
Maintainers usually reply within 1 day
-
bug need-fix
Difficulty 3/5 1-2 days Newbie friendliness 55/100
hoverkraft-tech/ci-github-common#693 ·
Maintainers usually reply within 1 day
All issues in hoverkraft-tech/ci-github-common
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
TheOdinProject/curriculum#31596 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mailcow/mailcow-dockerized#7725 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
solana-foundation/solana-com#2579 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
vercel-labs/agent-skills#385 ·
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
danielcuesta007/skeptic#73 ·
Maintainers usually reply within 1 day