Discussion:
[MediaWiki-commits] [Gerrit] mediawiki/vagrant[stretch-migration]: rake: move test definitions to tests directory
BryanDavis (Code Review)
2017-12-26 01:06:25 UTC
Permalink
BryanDavis has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/400201 )

Change subject: rake: move test definitions to tests directory
......................................................................

rake: move test definitions to tests directory

Clean up the root directly slightly by moving the Cucumber and RSpec
test files into a 'tests' directory.

Change-Id: I5847f5e122ea8497aeb7bbb33b8d024972ff6211
---
M Rakefile
R tests/features/config.feature
R tests/features/role_settings.feature
R tests/features/roles.feature
R tests/features/step_definitions/common_steps.rb
R tests/features/step_definitions/roles_steps.rb
R tests/features/step_definitions/settings_steps.rb
R tests/features/support/env.rb
R tests/features/support/hooks.rb
R tests/features/support/output_helper.rb
R tests/spec/mediawiki_vagrant/environment_spec.rb
R tests/spec/mediawiki_vagrant/setting_spec.rb
R tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
R tests/spec/mediawiki_vagrant/settings_definer_spec.rb
R tests/spec/mediawiki_vagrant/settings_spec.rb
R tests/spec/spec_helper.rb
R tests/spec/support/mock_environment.rb
R tests/spec/support/string.rb
18 files changed, 10 insertions(+), 7 deletions(-)


git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant refs/changes/01/400201/1

diff --git a/Rakefile b/Rakefile
index f7c978f..37e3391 100644
--- a/Rakefile
+++ b/Rakefile
@@ -33,9 +33,12 @@
config.log_format = '%{path}:%{line} %{KIND}: %{message}'
end
Cucumber::Rake::Task.new(:cucumber) do |t|
+ t.cucumber_opts = '-r tests/features tests/features'
t.fork = false
end
-RSpec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.pattern = 'tests/spec/**{,/*/**}/*_spec.rb'
+end
RuboCop::RakeTask.new(:rubocop)

task default: [:test]
diff --git a/features/config.feature b/tests/features/config.feature
similarity index 100%
rename from features/config.feature
rename to tests/features/config.feature
diff --git a/features/role_settings.feature b/tests/features/role_settings.feature
similarity index 100%
rename from features/role_settings.feature
rename to tests/features/role_settings.feature
diff --git a/features/roles.feature b/tests/features/roles.feature
similarity index 100%
rename from features/roles.feature
rename to tests/features/roles.feature
diff --git a/features/step_definitions/common_steps.rb b/tests/features/step_definitions/common_steps.rb
similarity index 100%
rename from features/step_definitions/common_steps.rb
rename to tests/features/step_definitions/common_steps.rb
diff --git a/features/step_definitions/roles_steps.rb b/tests/features/step_definitions/roles_steps.rb
similarity index 100%
rename from features/step_definitions/roles_steps.rb
rename to tests/features/step_definitions/roles_steps.rb
diff --git a/features/step_definitions/settings_steps.rb b/tests/features/step_definitions/settings_steps.rb
similarity index 100%
rename from features/step_definitions/settings_steps.rb
rename to tests/features/step_definitions/settings_steps.rb
diff --git a/features/support/env.rb b/tests/features/support/env.rb
similarity index 100%
rename from features/support/env.rb
rename to tests/features/support/env.rb
diff --git a/features/support/hooks.rb b/tests/features/support/hooks.rb
similarity index 100%
rename from features/support/hooks.rb
rename to tests/features/support/hooks.rb
diff --git a/features/support/output_helper.rb b/tests/features/support/output_helper.rb
similarity index 100%
rename from features/support/output_helper.rb
rename to tests/features/support/output_helper.rb
diff --git a/spec/mediawiki_vagrant/environment_spec.rb b/tests/spec/mediawiki_vagrant/environment_spec.rb
similarity index 99%
rename from spec/mediawiki_vagrant/environment_spec.rb
rename to tests/spec/mediawiki_vagrant/environment_spec.rb
index f48d922..555aa70 100644
--- a/spec/mediawiki_vagrant/environment_spec.rb
+++ b/tests/spec/mediawiki_vagrant/environment_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
require 'mediawiki-vagrant/environment'

module MediaWikiVagrant
@@ -473,7 +473,7 @@
subject { environment.valid? }

context 'when the environment directory is the project directory' do
- let(:environment) { Environment.new(File.expand_path('../../../', __FILE__)) }
+ let(:environment) { Environment.new(File.expand_path('../../../../', __FILE__)) }

it { is_expected.to be(true) }
end
diff --git a/spec/mediawiki_vagrant/setting_spec.rb b/tests/spec/mediawiki_vagrant/setting_spec.rb
similarity index 98%
rename from spec/mediawiki_vagrant/setting_spec.rb
rename to tests/spec/mediawiki_vagrant/setting_spec.rb
index dd00602..f5ac90f 100644
--- a/spec/mediawiki_vagrant/setting_spec.rb
+++ b/tests/spec/mediawiki_vagrant/setting_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
require 'mediawiki-vagrant/setting'

module MediaWikiVagrant
diff --git a/spec/mediawiki_vagrant/settings/definitions_spec.rb b/tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
similarity index 99%
rename from spec/mediawiki_vagrant/settings/definitions_spec.rb
rename to tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
index cfa59a0..2a4603d 100644
--- a/spec/mediawiki_vagrant/settings/definitions_spec.rb
+++ b/tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../../spec_helper'
require 'mediawiki-vagrant/environment'
require 'mediawiki-vagrant/settings/definitions'

diff --git a/spec/mediawiki_vagrant/settings_definer_spec.rb b/tests/spec/mediawiki_vagrant/settings_definer_spec.rb
similarity index 96%
rename from spec/mediawiki_vagrant/settings_definer_spec.rb
rename to tests/spec/mediawiki_vagrant/settings_definer_spec.rb
index c30dde0..67b4b22 100644
--- a/spec/mediawiki_vagrant/settings_definer_spec.rb
+++ b/tests/spec/mediawiki_vagrant/settings_definer_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
require 'mediawiki-vagrant/settings_definer'

module MediaWikiVagrant
diff --git a/spec/mediawiki_vagrant/settings_spec.rb b/tests/spec/mediawiki_vagrant/settings_spec.rb
similarity index 99%
rename from spec/mediawiki_vagrant/settings_spec.rb
rename to tests/spec/mediawiki_vagrant/settings_spec.rb
index 171ebea..f540927 100644
--- a/spec/mediawiki_vagrant/settings_spec.rb
+++ b/tests/spec/mediawiki_vagrant/settings_spec.rb
@@ -1,4 +1,4 @@
-require 'spec_helper'
+require_relative '../spec_helper'
require 'mediawiki-vagrant/settings'

module MediaWikiVagrant
diff --git a/spec/spec_helper.rb b/tests/spec/spec_helper.rb
similarity index 100%
rename from spec/spec_helper.rb
rename to tests/spec/spec_helper.rb
diff --git a/spec/support/mock_environment.rb b/tests/spec/support/mock_environment.rb
similarity index 100%
rename from spec/support/mock_environment.rb
rename to tests/spec/support/mock_environment.rb
diff --git a/spec/support/string.rb b/tests/spec/support/string.rb
similarity index 100%
rename from spec/support/string.rb
rename to tests/spec/support/string.rb
--
To view, visit https://gerrit.wikimedia.org/r/400201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5847f5e122ea8497aeb7bbb33b8d024972ff6211
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis <***@wikimedia.org>
jenkins-bot (Code Review)
2017-12-31 14:39:47 UTC
Permalink
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/400201 )

Change subject: rake: move test definitions to tests directory
......................................................................


rake: move test definitions to tests directory

Clean up the root directly slightly by moving the Cucumber and RSpec
test files into a 'tests' directory.

Change-Id: I5847f5e122ea8497aeb7bbb33b8d024972ff6211
---
M Rakefile
R tests/features/config.feature
R tests/features/role_settings.feature
R tests/features/roles.feature
R tests/features/step_definitions/common_steps.rb
R tests/features/step_definitions/roles_steps.rb
R tests/features/step_definitions/settings_steps.rb
R tests/features/support/env.rb
R tests/features/support/hooks.rb
R tests/features/support/output_helper.rb
R tests/spec/mediawiki_vagrant/environment_spec.rb
R tests/spec/mediawiki_vagrant/setting_spec.rb
R tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
R tests/spec/mediawiki_vagrant/settings_definer_spec.rb
R tests/spec/mediawiki_vagrant/settings_spec.rb
R tests/spec/spec_helper.rb
R tests/spec/support/mock_environment.rb
R tests/spec/support/string.rb
18 files changed, 5 insertions(+), 2 deletions(-)

Approvals:
Hashar: Looks good to me, approved
jenkins-bot: Verified



diff --git a/Rakefile b/Rakefile
index f7c978f..b057e5a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -33,9 +33,12 @@
config.log_format = '%{path}:%{line} %{KIND}: %{message}'
end
Cucumber::Rake::Task.new(:cucumber) do |t|
+ t.cucumber_opts = '-r tests/features tests/features'
t.fork = false
end
-RSpec::Core::RakeTask.new(:spec)
+RSpec::Core::RakeTask.new(:spec) do |t|
+ t.rspec_opts = '-I tests/spec --default-path tests'
+end
RuboCop::RakeTask.new(:rubocop)

task default: [:test]
diff --git a/features/config.feature b/tests/features/config.feature
similarity index 100%
rename from features/config.feature
rename to tests/features/config.feature
diff --git a/features/role_settings.feature b/tests/features/role_settings.feature
similarity index 100%
rename from features/role_settings.feature
rename to tests/features/role_settings.feature
diff --git a/features/roles.feature b/tests/features/roles.feature
similarity index 100%
rename from features/roles.feature
rename to tests/features/roles.feature
diff --git a/features/step_definitions/common_steps.rb b/tests/features/step_definitions/common_steps.rb
similarity index 100%
rename from features/step_definitions/common_steps.rb
rename to tests/features/step_definitions/common_steps.rb
diff --git a/features/step_definitions/roles_steps.rb b/tests/features/step_definitions/roles_steps.rb
similarity index 100%
rename from features/step_definitions/roles_steps.rb
rename to tests/features/step_definitions/roles_steps.rb
diff --git a/features/step_definitions/settings_steps.rb b/tests/features/step_definitions/settings_steps.rb
similarity index 100%
rename from features/step_definitions/settings_steps.rb
rename to tests/features/step_definitions/settings_steps.rb
diff --git a/features/support/env.rb b/tests/features/support/env.rb
similarity index 100%
rename from features/support/env.rb
rename to tests/features/support/env.rb
diff --git a/features/support/hooks.rb b/tests/features/support/hooks.rb
similarity index 100%
rename from features/support/hooks.rb
rename to tests/features/support/hooks.rb
diff --git a/features/support/output_helper.rb b/tests/features/support/output_helper.rb
similarity index 100%
rename from features/support/output_helper.rb
rename to tests/features/support/output_helper.rb
diff --git a/spec/mediawiki_vagrant/environment_spec.rb b/tests/spec/mediawiki_vagrant/environment_spec.rb
similarity index 99%
rename from spec/mediawiki_vagrant/environment_spec.rb
rename to tests/spec/mediawiki_vagrant/environment_spec.rb
index f48d922..3a1969b 100644
--- a/spec/mediawiki_vagrant/environment_spec.rb
+++ b/tests/spec/mediawiki_vagrant/environment_spec.rb
@@ -473,7 +473,7 @@
subject { environment.valid? }

context 'when the environment directory is the project directory' do
- let(:environment) { Environment.new(File.expand_path('../../../', __FILE__)) }
+ let(:environment) { Environment.new(File.expand_path('../../../../', __FILE__)) }

it { is_expected.to be(true) }
end
diff --git a/spec/mediawiki_vagrant/setting_spec.rb b/tests/spec/mediawiki_vagrant/setting_spec.rb
similarity index 100%
rename from spec/mediawiki_vagrant/setting_spec.rb
rename to tests/spec/mediawiki_vagrant/setting_spec.rb
diff --git a/spec/mediawiki_vagrant/settings/definitions_spec.rb b/tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
similarity index 100%
rename from spec/mediawiki_vagrant/settings/definitions_spec.rb
rename to tests/spec/mediawiki_vagrant/settings/definitions_spec.rb
diff --git a/spec/mediawiki_vagrant/settings_definer_spec.rb b/tests/spec/mediawiki_vagrant/settings_definer_spec.rb
similarity index 100%
rename from spec/mediawiki_vagrant/settings_definer_spec.rb
rename to tests/spec/mediawiki_vagrant/settings_definer_spec.rb
diff --git a/spec/mediawiki_vagrant/settings_spec.rb b/tests/spec/mediawiki_vagrant/settings_spec.rb
similarity index 100%
rename from spec/mediawiki_vagrant/settings_spec.rb
rename to tests/spec/mediawiki_vagrant/settings_spec.rb
diff --git a/spec/spec_helper.rb b/tests/spec/spec_helper.rb
similarity index 100%
rename from spec/spec_helper.rb
rename to tests/spec/spec_helper.rb
diff --git a/spec/support/mock_environment.rb b/tests/spec/support/mock_environment.rb
similarity index 100%
rename from spec/support/mock_environment.rb
rename to tests/spec/support/mock_environment.rb
diff --git a/spec/support/string.rb b/tests/spec/support/string.rb
similarity index 100%
rename from spec/support/string.rb
rename to tests/spec/support/string.rb
--
To view, visit https://gerrit.wikimedia.org/r/400201
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5847f5e122ea8497aeb7bbb33b8d024972ff6211
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: BryanDavis <***@wikimedia.org>
Gerrit-Reviewer: Dduvall <***@wikimedia.org>
Gerrit-Reviewer: Hashar <***@free.fr>
Gerrit-Reviewer: Zfilipin <***@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>
Loading...