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

Provides art command #1191

Merged
merged 3 commits into from Sep 14, 2016
Merged

Conversation

dustinleblanc
Copy link
Contributor

Still need to write proper test cases. but the change to the ./bin/terminus.php is pretty important, so we may want to get this merged.

to use the art command, just run ./bin/terminus.php art rocket and enjoy

@pantheon-mentionbot
Copy link

@dustinleblanc, thanks for your PR! By analyzing the blame information on this pull request, we identified @greg-1-anderson, @TeslaDethray and @bensheldon to be potential reviewers

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 13.982% when pulling 2d4e1bd on dustinleblanc:artify into d57ad1e on pantheon-systems:master.

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 13.982% when pulling b3d200c on dustinleblanc:artify into d57ad1e on pantheon-systems:master.

@@ -28,8 +28,7 @@
$container = new Container();
$input = new ArgvInput($_SERVER['argv']);
$output = new ConsoleOutput();
$roboConfig = new \Robo\Config(); // TODO: make Terminus Config extend \Robo\Config and use $config here
Robo::configureContainer($container, $roboConfig, $input, $output, $application);
Robo::configureContainer($container, $config, $input, $output, $application);
Copy link
Member

Choose a reason for hiding this comment

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

I guess I forgot to do this in my previous PR. Good catch.

@TeslaDethray
Copy link
Contributor

@dustinleblanc Please open a separate PR for the change to bin/terminus.php.

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 13.982% when pulling b3d200c on dustinleblanc:artify into d57ad1e on pantheon-systems:master.

@dustinleblanc
Copy link
Contributor Author

Done, see #1192

@dustinleblanc
Copy link
Contributor Author

I <3 git cherry-pick sha

@TeslaDethray
Copy link
Contributor

Thank you for doing that so promptly, @dustinleblanc. I didn't realize that your base branch is out-of-date, though.
https://github.com/pantheon-systems/terminus/blob/master/bin/terminus.php

@dustinleblanc
Copy link
Contributor Author

shouldn't be, it was rebased, and the current version still looks to be injecting $roboConfig which doesn't instantiate our constants. I need it to inject our config so that I can get the asset path

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling 752cbdf on dustinleblanc:artify into 0f26f81 on pantheon-systems:master.

@TeslaDethray
Copy link
Contributor

#1192/#1193 is merged.

@dustinleblanc
Copy link
Contributor Author

@TeslaDethray 👍 I'll rebase this, get testing finished, and re-submit

@coveralls
Copy link

coveralls commented Sep 13, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling 34a293f on dustinleblanc:artify into 3c6909f on pantheon-systems:master.

@dustinleblanc dustinleblanc changed the title [WIP] Provides art command Provides art command Sep 14, 2016
@@ -24,7 +24,8 @@
"autoload": {
"psr-4": {
"Terminus\\": ["php/", "php/Terminus/"],
"Pantheon\\Terminus\\": "src/"
"Pantheon\\Terminus\\": "src/",
"Pantheon\\Terminus\\Tests\\": "tests/"
Copy link
Member

Choose a reason for hiding this comment

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

I usually prefer to make this tests/src so that your test classes are not mixed in with your other testing files. Individual project variation is fine here, though -- up to @TeslaDethray

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 actually rebasing to cleanup right now

Copy link
Member

Choose a reason for hiding this comment

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

Reading further, it seems you only added this for tests/CommandTestCase.php. It should not be necessary to add an entry to the autoloader for this file (which I do think belongs immediately inside tests), as phpunit should already be loading it. Um, mistake, sorry, that's wrong. This is necessary.

When adding tests directory to the autoloader, you should put them in autoload-dev rather than autoload.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, misread your code the first time. Corrected my comment, you were right. Just move the directive to autoload-dev and it's perfect.

@greg-1-anderson
Copy link
Member

Great work -- love the test class!

@dustinleblanc
Copy link
Contributor Author

Thanks! I'm hoping it makes it easier for us to run faster tests that can load up a whole command, tip to tail and assert against it easily.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 14.05% when pulling 52d9ccf on dustinleblanc:artify into 3c6909f on pantheon-systems:master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling 52d9ccf on dustinleblanc:artify into 3c6909f on pantheon-systems:master.

@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling c701a8f on dustinleblanc:artify into 3c6909f on pantheon-systems:master.

@dustinleblanc
Copy link
Contributor Author

@TeslaDethray @greg-1-anderson Something that just occurred to me, though PHPUnit is running these, and they are good n snappy, they are functional tests rather than true unit tests. Should they be separated?

@TeslaDethray
Copy link
Contributor

@dustinleblanc I was hoping that the protected functions, retrieveArt and and validate asset, would be tested individually, like @ajbarry has done in the connection:info PR.

@dustinleblanc
Copy link
Contributor Author

@TeslaDethray sure! That will certainly increase our test coverage :)

@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling 2faaf27 on dustinleblanc:artify into 3c6909f on pantheon-systems:master.

@greg-1-anderson
Copy link
Member

I often use phpunit to write functional tests. I don't always separate these from unit tests, although some projects do.

If separated, all of the tests should run in a single execution of phpunit, so that our test coverage can be calculated accurately.

@dustinleblanc
Copy link
Contributor Author

@TeslaDethray oh yeah, I just realized that will require the reflection dance...I'll back burner it for now and perhaps wait for that to settle and just integrate whatever helpers come out of that if we do indeed want to test protected/private members.

@greg-1-anderson
Copy link
Member

I think the general procedure should be:

  1. Test the public methods.
  2. Can I increase coverage by using reflection to test protected methods?
  3. Can I increase coverage by using a test double and asserting that a method was called?

Avoid 2. and 3. unless necessary.

@ajbarry
Copy link
Contributor

ajbarry commented Sep 14, 2016 via email

@coveralls
Copy link

coveralls commented Sep 14, 2016

Coverage Status

Coverage remained the same at 14.05% when pulling d5e986d on dustinleblanc:artify into 859fce3 on pantheon-systems:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 14.05% when pulling 3e47e37 on dustinleblanc:artify into 3584938 on pantheon-systems:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 14.05% when pulling 3e47e37 on dustinleblanc:artify into 3584938 on pantheon-systems:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 14.05% when pulling 3e47e37 on dustinleblanc:artify into 3584938 on pantheon-systems:master.

@TeslaDethray
Copy link
Contributor

Good work! I'm merging this in to build on.

@TeslaDethray TeslaDethray merged commit da4f14b into pantheon-systems:master Sep 14, 2016
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.

None yet

6 participants