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

[test-case-reporting] Process e2e test reports correctly #981

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rafer45
Copy link
Contributor

@Rafer45 Rafer45 commented Aug 20, 2020

No description provided.

@Rafer45 Rafer45 self-assigned this Aug 20, 2020
@google-cla google-cla bot added the cla: yes label Aug 20, 2020
});
let resultList: Array<KarmaReporter.TestResult>;

if (job.testSuiteType === 'e2e') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could add a field to reports describing the structure of the reporter (mocha vs karma) -- I think that would be clearer than the (currently implicit) connection between e2e tests and the mocha reporter.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. We could then make this if(e2e)-elseif(unit|integration)-else(error-unknown)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I mean changing reports from this:

{
  job: // job info
  build: // build info
  results: // results info in some shape
}

to this:

{
  job: // job info
  build: // build info
  results: // results info in some shape
  reportType: // mocha or karma
}

It's redundant but it's more readable imo, thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would almost be in favor of

{
  reportType: // blah
  report: { job, build, results )
}

as reportType could eventually be something like github-actions-unit which might have a different report structure re: builds/jobs. Either is fine though IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like that; could you do that in a follow-up PR once I'm gone?

test-case-reporting/src/test_result_record.ts Show resolved Hide resolved
});
let resultList: Array<KarmaReporter.TestResult>;

if (job.testSuiteType === 'e2e') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. We could then make this if(e2e)-elseif(unit|integration)-else(error-unknown)

});
let resultList: Array<KarmaReporter.TestResult>;

if (job.testSuiteType === 'e2e') {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would almost be in favor of

{
  reportType: // blah
  report: { job, build, results )
}

as reportType could eventually be something like github-actions-unit which might have a different report structure re: builds/jobs. Either is fine though IMO

// Types for the JSON reports generated by Mocha
// Supposed to match the reports exactly.
namespace MochaReporter {
export interface TestResultReport {
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a parameterized type TestResultReport<T>, with testResults: Array<T>. Doesn't need to happen here if it's non-trivial, esp. since it's your last day, but maybe add a TODO(rcebulko) here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like for the KarmaReporter.TestResult type to be used by different reporters for consistency, hence why I'd like to move it to a different namespace.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rsimha rsimha assigned rileyajones and unassigned Rafer45 Jun 3, 2021
@rileyajones rileyajones removed their assignment Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants