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

Create test command #1

Merged
merged 21 commits into from
Jan 24, 2017
Merged

Create test command #1

merged 21 commits into from
Jan 24, 2017

Conversation

maier49
Copy link
Contributor

@maier49 maier49 commented Jan 11, 2017

Delegates to cli-build to build tests and then runs them using intern-runner.

Copy link
Member

@dylans dylans left a comment

Choose a reason for hiding this comment

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

Overall this looks really helpful, mostly just added various meta comments for things I noticed. I do wonder if we want to add support for some of the Intern 3.4 features (performance, a11y, and visual regression testing) as options, though that's probably best done via a separate issue?

[![npm version](https://badge.fury.io/js/dojo-cli-test-intern.svg)](http://badge.fury.io/js/dojo-cli-test-intern)
-->

The official dojo 2 test command.
Copy link
Member

Choose a reason for hiding this comment

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

Dojo 2 (capitalization)


Test cases MUST be written using [Intern](https://theintern.github.io) using the Object test interface and Assert assertion interface.

90% branch coverage MUST be provided for all code submitted to this repository, as reported by istanbul’s combined coverage results for all supported platforms.
Copy link
Member

Choose a reason for hiding this comment

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

Istanbul (capitalization)


* [Third-party lib one](https//github.com/foo/bar) ([New BSD](http://opensource.org/licenses/BSD-3-Clause))

© 2004–2016 Dojo Foundation & contributors. [New BSD](http://opensource.org/licenses/BSD-3-Clause) license.
Copy link
Member

Choose a reason for hiding this comment

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

Should now be JS Foundation. Should just link to our own LICENSE file probably.

The "New" BSD License
*********************

Copyright (c) 2015 - 2016, The Dojo Foundation
Copy link
Member

Choose a reason for hiding this comment

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

2017 and JS Foundation.

{
"name": "dojo-cli-test-intern",
"version": "2.0.0-pre",
"description": "test a dojo 2 application",
Copy link
Member

Choose a reason for hiding this comment

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

Test a Dojo 2 application

{ browserName: 'firefox', version: '43', platform: 'Windows 10' },
{ browserName: 'chrome', platform: 'Windows 10' },
// { browserName: 'safari', version: '9', platform: 'OS X 10.11' },
{ browserName: 'android', platform: 'Linux', version: '4.4', deviceName: 'Google Nexus 7 HD Emulator' }// ,
Copy link
Member

Choose a reason for hiding this comment

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

Should we also be testing Chrome for Android separately?

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 commented this out actually because I don't believe the issue with android on saucelabs have been resolved yet.

{ browserName: 'internet explorer', version: [ '10', '11' ], platform: 'WINDOWS' },
{ browserName: 'firefox', platform: 'WINDOWS' },
{ browserName: 'chrome', platform: 'WINDOWS' }/*,
{ browserName: 'Safari', version: '9', platform: 'OS X' }*/
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a few more examples should be commented out, e.g other browsers for Mac or Linux?

register(helper: Helper) {
helper.yargs.option('c', {
alias: 'config',
describe: 'Specifies what configuration to test with: browserstack(default), \'saucelabs\', or \'local\'ly.',
Copy link
Member

Choose a reason for hiding this comment

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

could also be testingbot or crossbrowsertesting (though perhaps not since we don't include configs for those environments, but perhaps we should)?

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 added configuration for testingbot. It might be documented somewhere but I couldn't see how to set testingbot credentials via environment variables so I also added command line args to specify credentials, and added the same support for browserstack and saucelabs as well.

crossbrowsertesting is not supported by the version of dig dug and intern that the create app cli sets as the application's dependency so I'm thinking we should hold off on adding support for that here until it'll work.

@@ -0,0 +1,20 @@
{
"version": "2.0.3",
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to not be 2.1.4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, updated.

"declaration": false,
"module": "umd",
"noImplicitAny": true,
"noImplicitThis": true,
Copy link
Member

Choose a reason for hiding this comment

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

I think there are a couple of other noImplicit* statements we've started to use?

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'm not sure. I think the last change was to add strictNullChecks: https://github.com/dojo/widgets/blob/master/tsconfig.json#L4-L15. Although if there are more that I should add I can of course put those in.

Copy link
Member

Choose a reason for hiding this comment

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

The others I'm thinking of are noUnusedParameters and noUnusedLocals , but I'm not sure if we've standardized on using those across the Dojo 2 packages? cc @agubler

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 are not using those because those are captured by linting.

@dylans dylans added this to the 2017.01 milestone Jan 11, 2017
define([
'./intern'
], function (intern) {
intern.tunnel = 'NullTunnel';
Copy link
Contributor

Choose a reason for hiding this comment

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

do we want to potentially use the SeleniumTunnel for local now?

@@ -0,0 +1,15 @@
define([
Copy link
Contributor

Choose a reason for hiding this comment

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

this file seems to mix tabs and spaces


The official Dojo 2 test command.

## Features
Copy link
Member

Choose a reason for hiding this comment

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

think we could fill out the readme a bit?

@@ -0,0 +1,44 @@
{
"name": "dojo-cli-test-intern",
Copy link
Member

Choose a reason for hiding this comment

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

@dojo/cli-test-intern

// { browserName: 'microsoftedge', platform: 'Windows 10' },
{ browserName: 'firefox', version: '49', platform: 'Windows 10' },
{ browserName: 'chrome', platform: 'Windows 10' },
// { browserName: 'safari', version: '9', platform: 'OS X 10.11' },
Copy link
Member

Choose a reason for hiding this comment

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

worth just removing the commented out platforms?

Copy link
Contributor Author

@maier49 maier49 Jan 16, 2017

Choose a reason for hiding this comment

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

@dylans requested I put in more commented out platforms as examples. I can see the usefulness of having some examples commented out so you can add some more browsers without having to go check saucelabs for the format.

Copy link
Member

Choose a reason for hiding this comment

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

but these configs are hidden from the consumer, so I'm not sure what benefit this will have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a really good point. I'll remove them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

run(helper: Helper, args: TestArgs) {
return new Promise((resolve, reject) => {
if (!helper.command.exists('build')) {
reject(Error('Required command: \'build\', does not exist'));
Copy link
Member

Choose a reason for hiding this comment

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

think we could say, have you npm install @dojo/cli-build? as part of the error?

register(helper: Helper) {
helper.yargs.option('c', {
alias: 'config',
describe: 'Specifies what configuration to test with: browserstack(default), \'testingbot\', \'saucelabs\', or \'local\'ly.',
Copy link
Member

Choose a reason for hiding this comment

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

do you think that local should be the default?

* Moved to scoped packages

* Make local tests the default

* Specify capabilities at run time so the project name can
be read from package.json
@maier49
Copy link
Contributor Author

maier49 commented Jan 18, 2017

@agubler With the changes merged into todoMVC here, and once these changes are merged into cli-build, this should work with todoMVC.

All your other feedback that I didn't reply to directly should be addressed, and I've tested this with the above changes locally. Testing locally, in saucelabs, and in browserstack all work. One thing to note: if you try to run in saucelabs or browserstack you will see a lot of failures. That's an issue with todoMVC though, as its tests fail in Firefox and IE 10/11, whether they're run via dojo test or grunt test.

@codecov-io
Copy link

codecov-io commented Jan 18, 2017

Current coverage is 100% (diff: 100%)

No coverage report found for master at 4e1ee44.

Powered by Codecov. Last update 4e1ee44...8f32841

@agubler agubler merged commit 2c8f8ae into dojo:master Jan 24, 2017
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