Skip to content

CP-3485 Pub serve single instance for coverage#212

Merged
jayudey-wf merged 1 commit intoWorkiva:masterfrom
Anrock:pub-serve-single-instance
Feb 9, 2017
Merged

CP-3485 Pub serve single instance for coverage#212
jayudey-wf merged 1 commit intoWorkiva:masterfrom
Anrock:pub-serve-single-instance

Conversation

@Anrock
Copy link
Copy Markdown

@Anrock Anrock commented Feb 7, 2017

Hello. This merge request changes coverage/api.dart so it uses single pub serve instance to run browser tests (if any) instead of starting and killing pub serve for each test. This reduces running time almost twice.

Copy link
Copy Markdown
Contributor

@evanweible-wf evanweible-wf left a comment

Choose a reason for hiding this comment

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

This looks really good, thank you for opening a PR @Anrock!

I just have a few comments, and then it looks like you'll need to run ddev format to fix up some formatting issues.

PubServeTask pubServeTask;
PubServeInfo serveInfo;

if (pubServe && pubServeTask == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

pubServeTask will always be null here since it is defined locally immediately before this

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oops, forgot to remove this check. At first it meant to start pub serve on demand if current test is browser test and no pub serve was running. I'll fix this and other issues tommorow. Thanks for feedback.

}

// Build or modify the HTML file to properly load the test.
File _createHtmlForTest(File test, File customHtml) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A slightly more accurate name here might be _createOrModifyHtmlForTest()

Future<List<int>> _runTestOnVm(String testPath) async {
const String _observatoryFailPattern = 'Could not start Observatory HTTP server';
const String _testsFailedPattern = 'Some tests failed.';
const String _testsPassedPattern = 'All tests passed!';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since these constants are used both here and in _runTestInBrowser() below, we should move them out so that they're only defined once.

@Anrock
Copy link
Copy Markdown
Author

Anrock commented Feb 8, 2017

@evanweible-wf fixed, please review.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Feb 8, 2017

Codecov Report

Merging #212 into master will not change coverage.

@@           Coverage Diff           @@
##           master     #212   +/-   ##
=======================================
  Coverage   21.63%   21.63%           
=======================================
  Files           7        7           
  Lines         171      171           
=======================================
  Hits           37       37           
  Misses        134      134

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4866635...364ec39. Read the comment docs.

@evanweible-wf
Copy link
Copy Markdown
Contributor

+1 looks great!

If you're willing, we usually try to squash all the commits into 1 prior to merging.

@Workiva/web-platform-pp

@Anrock
Copy link
Copy Markdown
Author

Anrock commented Feb 9, 2017

@evanweible-wf squashed.

@dustinlessard-wf
Copy link
Copy Markdown

+1

1 similar comment
@evanweible-wf
Copy link
Copy Markdown
Contributor

+1

@evanweible-wf
Copy link
Copy Markdown
Contributor

+10

  • CI passes (existing coverage tests already exercise these changes)

@evanweible-wf
Copy link
Copy Markdown
Contributor

@jayudey-wf ready for you

@rmconsole3-wf rmconsole3-wf changed the title Pub serve single instance for coverage CP-3485 Pub serve single instance for coverage Feb 9, 2017
@jayudey-wf
Copy link
Copy Markdown
Contributor

jayudey-wf commented Feb 9, 2017

QA Resource Approval: +1

  • Testing instruction
  • Dev +1's
  • Dev/QA +10 with detail of what was tested
    • performed and documented by Evan
  • Unit test created/updated (current testing is sufficient)
  • All unit tests pass

Merging into master.

@jayudey-wf jayudey-wf merged commit 9bef141 into Workiva:master Feb 9, 2017
@evanweible-wf
Copy link
Copy Markdown
Contributor

Thanks again for the contribution @Anrock! This is included in the latest release (1.7.2).

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.

5 participants