require "rake/testtask"

namespace :test do
  Rake::TestTask.new(publishing_schemas: "test:prepare") do |t|
    t.libs << "test"
    t.test_files = `grep -rlE "valid_against_(links_)?schema" test`.lines.map(&:chomp)
    t.warning = false
  end

  Rake::Task["test:publishing_schemas"].comment = "Test publishing API presenters against external schemas"
end

require "rake/testtask"

namespace :test do
  Rake::TestTask.new(publishing_schemas: "test:prepare") do |t|
    t.libs << "test"
    t.test_files = FileList["test/unit/finder_schema_validation_test.rb", "test/unit/presenters/publishing_api/*_test.rb"]
    t.warning = false
  end

  Rake::Task["test:publishing_schemas"].comment = "Test publishing API presenters against external schemas"
end

Change method of selecting schema test cases
Change method of selecting schema test cases

We are currently running schema tests by grepping the test names for a
specific string. However there are tests for valid schemas that do not
have a name in this format that we are currently missing.

By running all the Publishing API presenter tests (and a validation test
for the hardcoded finders), we will ensure no tests are missed.

This adds an extra (approximately) 15 seconds to the test run, but
ensures we have full test coverage.
