Merge pull request #4681 from inspec/zenspider/fixtures

Moved test/unit/mock/* to test/fixtures
This commit is contained in:
Ryan Davis 2019-11-12 12:21:26 -08:00 committed by GitHub
commit f7afdf1965
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
743 changed files with 136 additions and 130 deletions

View file

@ -27,5 +27,5 @@ plugins:
exclude_patterns:
- "www/source/javascripts/"
- "examples/"
- "test/unit/mock/profiles/"
- "test/kitchen"
- "test/fixtures/profiles/"
- "test/kitchen"

View file

@ -2,8 +2,8 @@ AllCops:
Exclude:
- 'test/kitchen/**/*'
- 'test/integration/**/controls/**/*.rb'
- 'test/unit/mock/profiles/**/*.rb'
- 'test/unit/mock/config_dirs/**/*.rb'
- 'test/fixtures/profiles/**/*.rb'
- 'test/fixtures/config_dirs/**/*.rb'
- 'lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/**/*'
- 'examples/**/controls/*.rb'
- 'vendor/bundle/**/*'

View file

@ -79,7 +79,7 @@ namespace :test do
missing.reject! { |f| ! File.file? f }
missing.reject! { |f| f =~ %r{test/(integration|cookbooks)} }
missing.reject! { |f| f =~ %r{test/unit/mock} }
missing.reject! { |f| f =~ %r{test/fixtures} }
missing.reject! { |f| f =~ /test.*helper/ }
missing.reject! { |f| f =~ %r{test/docker} }
@ -207,7 +207,7 @@ namespace :test do
task unit: [:accept_license]
task :resources do
tests = Dir["test/unit/resource/*_test.rb"]
tests = Dir["test/unit/resources/*_test.rb"]
return if tests.empty?
sh(Gem.ruby, "test/docker_test.rb", *tests)

View file

@ -12,7 +12,7 @@ Additionally, the ways in which the classes relate is not straightforward.
The main FilterTable code is in [inspec/utils/filter.rb](https://github.com/chef/inspec/blob/master/lib/inspec/utils/filter.rb).
Also educational is the unit test for Filtertable, at test/unit/utils/filter_table_test.rb . Recent work has focused on using functional tests to exercise FilterTable; see test/unit/mocks/profiles/filter_table and test/functional/filter_table_test.rb .
Also educational is the unit test for Filtertable, at test/unit/utils/filter_table_test.rb . Recent work has focused on using functional tests to exercise FilterTable; see test/fixtures/profiles/filter_table and test/functional/filter_table_test.rb .
The file inspec/utils/filter_array.rb appears to be unrelated.

View file

@ -62,7 +62,7 @@ Putting this all together, here is a plugins.json file from the Chef InSpec test
{
"name": "inspec-meaning-of-life",
"installation_type": "path",
"installation_path": "test/unit/mock/plugins/meaning_of_life_path_mode/inspec-meaning-of-life"
"installation_path": "test/fixtures/plugins/meaning_of_life_path_mode/inspec-meaning-of-life"
}
]
}

View file

@ -19,6 +19,6 @@ When writing your functional tests, you can point InSpec at the various test fix
## Using test fixtures provided with core inspec
InSpec itself ships with many test fixtures - not just profiles, but attribute files, configuration directories, and more. Examine them at [the fixtures directory](https://github.com/inspec/inspec/tree/master/test/unit/mock)
InSpec itself ships with many test fixtures - not just profiles, but attribute files, configuration directories, and more. Examine them at [the fixtures directory](https://github.com/inspec/inspec/tree/master/test/fixtures)
To use them, see the helper.rb file included in the example at test/helper.rb .
To use them, see the helper.rb file included in the example at test/helper.rb .

View file

@ -19,6 +19,6 @@ When writing your functional tests, you can point InSpec at the various test fix
## Using test fixtures provided with the `inspec` source code
InSpec itself ships with many test fixtures - not just profiles, but attribute files, configuration directories, and more. Examine them at [the fixtures directory](https://github.com/inspec/inspec/tree/master/test/unit/mock)
InSpec itself ships with many test fixtures - not just profiles, but attribute files, configuration directories, and more. Examine them at [the fixtures directory](https://github.com/inspec/inspec/tree/master/test/fixtures)
To use them, see the helper.rb file included in the example at test/helper.rb .
To use them, see the helper.rb file included in the example at test/helper.rb .

View file

@ -29,7 +29,7 @@ class PluginManagerCliInstall < Minitest::Test
resolved_path: File.join(core_config_dir_path, "test-fixture-1-float", "gems", ruby_abi_version, "gems", "inspec-test-fixture-0.1.0", "lib", "inspec-test-fixture.rb"),
},
"refers_to_a_relative_path" => {
given: File.join("test", "unit", "mock", "plugins", "inspec-test-fixture", "lib", "inspec-test-fixture.rb"),
given: File.join("test", "fixtures", "plugins", "inspec-test-fixture", "lib", "inspec-test-fixture.rb"),
},
"refers_to_a_train_plugin" => {
given: File.join(core_config_dir_path, "train-test-fixture", "gems", ruby_abi_version, "gems", "train-test-fixture-0.1.0", "lib", "train-test-fixture.rb"),

View file

@ -9,7 +9,7 @@ class PluginManagerCliDefinitionTests < Minitest::Test
@@orig_home = Dir.home
def setup
mock_path = File.expand_path "test/unit/mock"
mock_path = File.expand_path "test/fixtures"
@config_dir_path = File.join(mock_path, "config_dirs")
ENV["HOME"] = File.join(@config_dir_path, "fakehome")

View file

@ -42,7 +42,7 @@ module CorePluginBaseHelper
let(:repo_path) { File.expand_path(File.join(__FILE__, "..", "..", "..", "..")) }
let(:inspec_path) { File.join(repo_path, "inspec-bin", "bin", "inspec") }
let(:exec_inspec) { [Gem.ruby, "-I#{libdir}", inspec_path].join " " }
let(:core_mock_path) { File.join(repo_path, "test", "unit", "mock") }
let(:core_mock_path) { File.join(repo_path, "test", "fixtures") }
let(:core_fixture_plugins_path) { File.join(core_mock_path, "plugins") }
let(:core_config_dir_path) { File.join(core_mock_path, "config_dirs") }

View file

@ -5,8 +5,8 @@
# 2. You are running from project root
eval "$(rbenv init -)"
PLUGIN_SRC_DIR=test/unit/mock/plugins/inspec-test-fixture
FIXTURE_BASE=test/unit/mock/config_dirs
PLUGIN_SRC_DIR=test/fixtures/plugins/inspec-test-fixture
FIXTURE_BASE=test/fixtures/config_dirs
FIXTURE_VERSIONS="1 2"
# The format here is "<actual_version>,<abi_version> <another_version><<another_abi_version>""
@ -44,4 +44,4 @@ for info in $RUBY_VERSIONS; do
cp -v "$GEM_DIR/specifications/ordinal_array-0.2.0.gemspec" "$GEM_DIR/gems/ordinal_array-0.2.0/ordinal_array.gemspec"
done
rbenv shell 2.6.2
rbenv shell 2.6.2

Some files were not shown because too many files have changed in this diff Show more