Skip to content

Fix #109 Provide docker mechanism in new project template#110

Open
racodond wants to merge 1 commit intomasterfrom
fix109
Open

Fix #109 Provide docker mechanism in new project template#110
racodond wants to merge 1 commit intomasterfrom
fix109

Conversation

@racodond
Copy link
Contributor

No description provided.


console.log(`Functional tests results from ${reportPath}:`);
console.log(` - Passed = ${passedTests}`);
console.log(` - Failed = ${failedTests}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule

console.log(`Functional tests results from ${reportPath}:`);
console.log(` - Passed = ${passedTests}`);
console.log(` - Failed = ${failedTests}`);
console.log(` - Skipped = ${skippedTests}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule

console.log(` - Skipped = ${skippedTests}`);

if (failedTests > 0 || skippedTests > 0) {
console.log('[ERROR] Not all tests have passed.');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule

}

if (expectedPassedTests >= 0 && parseInt(expectedPassedTests, 10) !== passedTests) {
console.log(`[ERROR] Expected number of passed tests (${expectedPassedTests}) does not match actual number of passed tests (${passedTests}).`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule
MINOR Split this 147 characters long line (which is greater than 140 authorized). rule

const failedTests = parseInt(require(reportPath).state.failed, 10);
const skippedTests = parseInt(require(reportPath).state.skipped, 10);

console.log(`Functional tests results from ${reportPath}:`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule

const skippedTests = parseInt(require(reportPath).state.skipped, 10);

console.log(`Functional tests results from ${reportPath}:`);
console.log(` - Passed = ${passedTests}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MAJOR Remove this logging statement. rule

@racodond racodond force-pushed the fix109 branch 3 times, most recently from 315a1af to b134abc Compare January 18, 2018 18:06
@racodond racodond requested a review from ncheutin January 18, 2018 18:12
@ncheutin
Copy link
Contributor

I’ll need to check that together, I have several questions to understand everything.

@racodond
Copy link
Contributor Author

SonarQube analysis reported 8 issues

  • MAJOR 7 major
  • MINOR 1 minor

Watch the comments in this conversation to review them.

1 extra issue

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR Gruntfile.js#L3: This function has 75 lines, which is greater than the 70 lines authorized. Split it into smaller functions. rule

@@ -0,0 +1,5 @@
#!/usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between Chrome and Firefox files?
If there's none, couldn't we have only one?

echo "Project dependencies installed."

echo "Running tests in Chrome Docker container..."
npx ntaf run --realm=docker-chrome --tagExpression='@mytest'
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove hard-coded "@mytest" tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This '@mytest' in on purpose. This is a template script for a developer to run a subset of scenarios.

echo "Project dependencies installed."

echo "Running tests in Chrome Docker container..."
npx ntaf run --realm=docker-chrome
Copy link
Contributor

Choose a reason for hiding this comment

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

As the only difference seems to be the realm that we pass to npx ntaf run (which make sense), could we simplify it by passing only the npm parameters to npx ntaf run-in-docker and hide the complexity behind? (in theory we should not expose end-user to underlying complexity and I fill like we're doing it when we ask him to create a shell script under docker/ directory and pass it into parameters.

Ideally we should use the run-in-docker same way we use npx ntaf run, meaning npy ntaf run-in-docker --realm=chrome.

I think it would also remove some code here.
We can discuss further if needed, I might not be clear :-)

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.

2 participants