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

Adding functionality to output test results in .xml format #77

Merged
merged 20 commits into from
Aug 27, 2019

Conversation

nairmai
Copy link
Collaborator

@nairmai nairmai commented Aug 26, 2019

  • Created a new class (XmlWriterService.ts) to provide this functionality
  • Wrote unit tests for this class (XmlWriterService.test.ts)
  • Added some helper utilities and interfaces (Utils.ts and types.ts)
  • Modified the options for the d-ser-t-cli flags and d-ser-t-service main.ts to handle xml output

Copy link
Collaborator

@zmmille2 zmmille2 left a comment

Choose a reason for hiding this comment

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

I'm not working on this close enough to feel comfortable approving, most of this looks good. Frankly not familiar with Typescript enough to know if interfaces are widely used, but I'd say that's the most important bit of my review.

packages/d-ser-t-cli/src/cli.ts Show resolved Hide resolved
const outputFileType = path.extname(String(this.outFile)).substr(1);
console.log('Output file type: ' + outputFileType);

if (outputFileType === 'json') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This block makes me think that we might want this.localFileService to be an interface that either jsonWriterService or xmlWriterService implements, each of which would have a writeToTextFile method. That way this if statement doesn't get too long.

That may be overkill and I'm not sure how many output file types we're really going to end up supporting.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I can totally see needing to extend this in the future. I think for now we want a working version of this merged in as soon as we can so I'll create an issue for this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

#80

packages/d-ser-t-service/src/main.ts Outdated Show resolved Hide resolved
*/
public static zeroPrefix(arr: string[]): string[] {
arr.forEach((elem, i) => {
if (Number(elem) < 10) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this would freak out if we ever got something negative. I don't actually think we should fix it, if we get a negative here I think we want it to fail, but interested to hear what others think

Copy link
Collaborator Author

@nairmai nairmai Aug 26, 2019

Choose a reason for hiding this comment

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

I wrote this with the only intention of using it to format timestamps neatly, which I assumed would never have a negative input, but I've added a check within that if statement to only prepend '0' if elem is within [0,10).

Copy link
Collaborator

@KatieProchilo KatieProchilo left a comment

Choose a reason for hiding this comment

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

The most pressing change is creating the test_results/ folder if it does not already exist.

We want to merge this in by EOD, so any other fixes you can get done by then would be an added bonus.

const outputFileType = path.extname(String(this.outFile)).substr(1);
console.log('Output file type: ' + outputFileType);

if (outputFileType === 'json') {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can totally see needing to extend this in the future. I think for now we want a working version of this merged in as soon as we can so I'll create an issue for this.

packages/d-ser-t-service/src/main.ts Outdated Show resolved Hide resolved
packages/d-ser-t-service/src/main.ts Outdated Show resolved Hide resolved
@nairmai nairmai merged commit 4c3e272 into master Aug 27, 2019
@Joll59 Joll59 deleted the mnair/xml-output branch September 10, 2019 18:06
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.

3 participants