94 Commits

Author SHA1 Message Date
Yossef Mendelssohn
535a9faf5f Refactor CLI#run tests
Now I can just stub `CLI#process` instead of caring what happens inside
it.

cf f0a9ad99e0
2012-10-05 15:50:51 -04:00
Yossef Mendelssohn
455ffb919b Fix repeated test definitions
Oh hey maybe I wanted to have two more tests instead of redefining a
couple.

MAYBE.
2012-10-05 15:48:03 -04:00
Yossef Mendelssohn
f0a9ad99e0 Refactoring CLI#run
If reporting is going to live within/around CLI#run, I want it to be
its own thing. It feels more right this way, except I don't much like
the `process` method name. I just don't have a good name for "actual
run" where "run" has been co-opted to mean "report on the actual run".
2012-10-05 15:44:27 -04:00
Yossef Mendelssohn
ea7719caa1 report → reporter
It makes more sense this way. I was trying too hard on the length
instead of the content.
2012-10-05 15:39:18 -04:00
Yossef Mendelssohn
9fe1b631fd ivar → attr 2012-10-05 15:34:23 -04:00
Yossef Mendelssohn
66c4796f3e Don't affect issues unless it's wanted 2012-10-05 02:16:55 -04:00
Yossef Mendelssohn
1a1070f04e Check for whether issues should be affected 2012-10-05 02:14:33 -04:00
Yossef Mendelssohn
6c879a8dc4 Give CLI a Checkout, too
It'll need this to check for master branch.

It's all coming together.
2012-10-05 02:05:41 -04:00
Yossef Mendelssohn
e1a5da7a55 Move master? from Config to Checkout
It belongs with sha/changes/dirty?, and you know it.
2012-10-05 02:04:17 -04:00
Yossef Mendelssohn
988c9803bb Report failure/success of CLI#run
There's some repetition I'm not sure about here. I went with what the
comment said, though.
2012-10-05 01:56:54 -04:00
Yossef Mendelssohn
71edf89ddf Add Reporter to CLI 2012-10-05 01:42:16 -04:00
Yossef Mendelssohn
8d97b2f15a Reporter tests stubs → Structs
So much easier to read and deal with.

My variable name choice is becoming questionable.
2012-10-05 01:35:31 -04:00
Yossef Mendelssohn
7445eb957c Use actual objects in Reporter tests
API and Puppet can be opaque to this test, as Puppet is only used for
the command and I don't want to (yet) mess with different sort of API
testing. Config/Checkout, on the other hand, are related more closely
and have some related logic I don't want to continue stubbing.

More stubbing could be exchanged with attr_writer use (like what I
added for Config), except those methods don't use ivars.
2012-10-05 01:25:47 -04:00
Yossef Mendelssohn
3e8bb436c2 Use actual Config object in Checkout tests
This makes it more difficult to test (or at least pretend to test) the
`Dir.chdir` use in `sha` and `changes`.

I'm okay with that.
2012-10-05 01:10:41 -04:00
Yossef Mendelssohn
a9c459dcb4 Explicitly set success for stubbed system call
There's a test that checks for this being false, but these tests just
assume it'll be true.
2012-10-05 01:02:17 -04:00
Yossef Mendelssohn
a35b136ea6 Actually set ENV vars in tests
I'll allow mock/stubbing on a lot of things, but I draw the line with
`ENV.expects(:[]).with('THIS').returns('that')`. Let's not be crazy.

Not that this pattern is so very much better. It's just actually
setting the values and using them, like the code is supposed to do.
2012-10-05 00:41:28 -04:00
Yossef Mendelssohn
d9264b31f8 line shortening and cleanup 2012-10-05 00:16:41 -04:00
Yossef Mendelssohn
71fadf88a7 Move sha from Reporter to Checkout 2012-10-04 23:37:45 -04:00
Yossef Mendelssohn
96b8f94111 Add comment when auto-closing issues 2012-10-04 23:32:20 -04:00
Yossef Mendelssohn
9c73e9104d Can label ongoing failures to leave them open 2012-10-04 23:23:42 -04:00
Yossef Mendelssohn
0caeeb14b4 Reporter can also close failures
This refers to the auto-opened failures, so we're looking for open
issues on this repo created by the same user and having the failure
label.
2012-10-04 23:15:14 -04:00
Yossef Mendelssohn
688d7aed8b actually use custom failure label in test 2012-10-04 22:54:36 -04:00
Yossef Mendelssohn
e02a63cdb9 Remove changes/dirty? from Config 2012-10-04 22:45:22 -04:00
Yossef Mendelssohn
821e30aa3a Use changes from Checkout instead of Config 2012-10-04 22:44:33 -04:00
Yossef Mendelssohn
e82f191f7f chdir when checking local changes
This seems like an oversight in the original code.
2012-10-04 22:40:38 -04:00
Yossef Mendelssohn
6926afea96 Add Boxen::Checkout
This class handles the local checkout of the boxen/boxen repo. Y'know,
things like saying whether there are changes.
2012-10-04 22:38:03 -04:00
Yossef Mendelssohn
10ca468bc1 Make failure label customizable 2012-10-04 22:27:56 -04:00
Yossef Mendelssohn
bf97e2b7a4 Add puppet command to failure details
Now the Reporter needs to know about the Puppeteer as well.

I'm not sure how I feel about a method called `command` returning an
array and consumers of that method needing to know to join it. On the
other hand, I don't really want to have a method called
`command_string`. It's kind of a dumb name.

It also makes the mock objects used in the tests more hairy, but those
should be ripped out and replaced with actual objects soon enough.
2012-10-04 17:53:51 -04:00
Yossef Mendelssohn
484e2c9df9 add failure label to created issue
We may want to make this label configurable, and also create it if
necessary.
2012-10-04 16:47:15 -04:00
Yossef Mendelssohn
50ec7f93c2 config ivar → attr_reader 2012-10-04 16:44:11 -04:00
Yossef Mendelssohn
e67995526a Add log to failure details
Adding Reporter#log and tests.
2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
f846c5e7d7 Add changes to failure details 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
acfe3095ec Add Config#changes and tests for it and #dirty? 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
cbc429959f Add Reporter#failure_details
Starting this off, more details forthcoming.
2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
b06c33434b Add Reporter#record_failure 2012-10-04 16:26:05 -04:00
Yossef Mendelssohn
36998d075c Test Config#api 2012-10-04 14:59:19 -04:00
John Barnette
4e051a10c4 Start extracting/porting a Boxen::Reporter 2012-10-03 21:59:16 -07:00
John Barnette
d00ea25ee3 Add Config#reponame 2012-10-03 21:36:06 -07:00
Will Farrington
f06defa4e0 Release 0.2.2 v0.2.2 2012-10-03 20:07:27 -07:00
Mike Skalnik
6c8cfc5fb1 Merge pull request #7 from boxen/add-preflight-tests
Add preflight tests
2012-10-03 19:53:30 -07:00
John Barnette
bb56d27ab1 Add a boxen_repodir fact 2012-10-03 18:56:06 -07:00
Will Farrington
4b748f3d4e caffeinate puppet run also 2012-10-03 16:56:31 -07:00
Will Farrington
1002900cbd add assertion for group flag in puppet run 2012-10-03 16:49:38 -07:00
Will Farrington
f306153830 Use caffeinate to prevent sleep during run 2012-10-03 16:49:27 -07:00
John Barnette
296d1655a9 Release 0.2.1 v0.2.1 2012-10-03 16:11:15 -07:00
John Barnette
384a81fb10 Don't track Gemfile.lock 2012-10-03 16:11:03 -07:00
Will Farrington
663b965a7b force puppet to try to own things with group admin, fixes chicken-egg problem with puppet group 2012-10-03 16:06:41 -07:00
John Barnette
5b5637acbf Release 0.2.0 v0.2.0 2012-10-03 15:19:01 -07:00
Will Farrington
986b1a8bbc hard-lock hiera dependency, eliminate need for json 2012-10-03 15:12:50 -07:00
John Barnette
8bde53257f Release v0.1.0 v0.1.0 2012-10-03 13:41:29 -07:00