Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

(do not merge) (qa-3110) spike rototiller create integration suite #78

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from

Conversation

er0ck
Copy link
Contributor

@er0ck er0ck commented Jun 21, 2017

(QA-3110) spike: rototiller create integration suite

* implement an integration test helper set
  * this creates a helper that can run a single task in rspec
* we could create another helper for rake -T and rake -D, etc, maybe
  * or it might make sense to just keep testing that stuff in acceptance
* this doesn't work
  * it appears to not run the commands, not clear why


(QA-3110) update CONTRIBUTING doc to reflect new test layout
  • this part needs a bit more work on how to run units vs. integration

@er0ck er0ck requested review from zreichert and samwoods1 June 21, 2017 20:51
@er0ck
Copy link
Contributor Author

er0ck commented Jun 21, 2017

can you guys figure out why this isn't working?
@zreichert @samwoods1

ah, right. Rake::TaskLib only registers a task. we'll have to reach into rake to run it.

edit:
okay, so rake executes (some of) the ruby in a Rakefile upon load:
https://github.com/ruby/rake/blob/master/lib/rake/application.rb#L767-L770

i tried skipping that step and defining a task in Rake::Application like:
Rake::Application.new.define_task(Rake::Task, *args, &block)
but then it doesn't have #add_env, #add_command, etc, in rake::task, of course

or it doesn't have Task methods, because RototillerTask is a child of TaskLib, not Rake::Task 😭
even if you give it a RototillerTask as scope:

[12] pry(#<RSpec::ExampleGroups::RototillerTestTask>)> app = Rake::Application.new.define_task(Rototiller::Task::RototillerTask, 'abstract-me' , &block)
NoMethodError: undefined method `scope_name' for Rototiller::Task::RototillerTask:Class
from /Users/erict/projects/rake/lib/rake/task_manager.rb:33:in `define_task'

so to get this to work we might be able to monkey patch Application.#load_imports in the test helper here. not sure how much time i want to spend on this, though.

@er0ck
Copy link
Contributor Author

er0ck commented Jun 21, 2017

crap, i always forget about [skip ci] for spikes

Eric Thompson added 2 commits June 21, 2017 17:18
* implement an integration test helper set
  * this creates a helper that can run a single task in rspec
* we could create another helper for rake -T and rake -D, etc, maybe
  * or it might make sense to just keep testing that stuff in acceptance
* this doesn't work
  * it appears to not run the commands, not clear why

[skip ci]
@er0ck er0ck force-pushed the improve/stable/QA-3110-spike_rototiller_create_integration_suite branch from 92990b4 to 3da02ac Compare June 22, 2017 00:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant