Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing many test suites on file #9

Closed
wants to merge 21 commits into from

Conversation

ETtestim
Copy link

Instead of assuming we get only one test suite in the file, now we parse all suites on file

src/junitParser.ts Outdated Show resolved Hide resolved
@ETtestim ETtestim requested a review from atlowChemi June 30, 2024 10:14
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
@ETtestim ETtestim requested a review from atlowChemi June 30, 2024 11:41
src/junitParser.ts Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Show resolved Hide resolved
@ETtestim ETtestim requested a review from atlowChemi July 1, 2024 06:33
src/junitParser.ts Outdated Show resolved Hide resolved
@barspielberg
Copy link

@ETtestim Can you add some unit tests?

@ETtestim
Copy link
Author

ETtestim commented Jul 1, 2024

@ETtestim Can you add some unit tests?

@ETtestim
Copy link
Author

ETtestim commented Jul 1, 2024

@atlowChemi @barspielberg You want to add vitest or some other 3 party for testing?

@ETtestim ETtestim requested a review from atlowChemi July 1, 2024 07:23
@atlowChemi
Copy link
Owner

@atlowChemi @barspielberg You want to add vitest or some other 3 party for testing?

I think for this simple use case there is no reason not to use the built-in node test-runner.

@barspielberg Thanks for that awesome comment 👍🏽

Copy link
Owner

@atlowChemi atlowChemi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as per to @barspielberg's comment regarding missing UT

@ETtestim ETtestim requested a review from atlowChemi July 1, 2024 13:22
package.json Outdated Show resolved Hide resolved
tsconfig.json Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
@atlowChemi atlowChemi dismissed their stale review July 2, 2024 07:36

The request for UT was fulfilled

@ETtestim ETtestim requested a review from atlowChemi July 7, 2024 14:23
src/junitParser.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
@ETtestim ETtestim requested a review from atlowChemi July 8, 2024 07:49
src/junitParser.ts Outdated Show resolved Hide resolved
@ETtestim ETtestim requested a review from atlowChemi July 8, 2024 12:17
.github/workflows/build.yaml Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
src/test/junitParser.test.ts Outdated Show resolved Hide resolved
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a test ensuring we only attempt calling Testim API when key provided for given Project ID?
Also a test validating the annotations, and not only the file name

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have another PR for this repo next sprint can we add those test then?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What PR? which sprint?
I am confused

src/test/junitParser.test.ts.snapshot Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
src/junitParser.ts Outdated Show resolved Hide resolved
Comment on lines +7 to +10
// @ts-expect-error
t.assert.strictEqual(testReports.length, 3);
// @ts-expect-error
t.assert.strictEqual(testReports[0].annotations.length, 2);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also just use assert directly and avoid // @ts-expect-error

Comment on lines +7 to +10
// @ts-expect-error
t.assert.strictEqual(testReports.length, 3);
// @ts-expect-error
t.assert.strictEqual(testReports[0].annotations.length, 2);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we snapshot test the entire testReports object?

@omril1
Copy link

omril1 commented Jul 21, 2024

@ETtestim
Copy link
Author

The code inside here was copied inside Testim code.
With the contribute file!
As I'm leaving Testim I'm closing this PR

@ETtestim ETtestim closed this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants