Test migration parity using existing integration tests

This commit is contained in:
Dylan Thacker-Smith
2022-11-24 11:05:14 -05:00
parent 871336753e
commit 0672ebfcbb
3 changed files with 43 additions and 5 deletions
+18 -1
View File
@@ -5,7 +5,7 @@ require 'rake/testtask'
$LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
require "liquid/version"
task(default: [:test, :rubocop])
task(default: [:test, "test:migrator_integration", :rubocop])
desc('run test suite with default parser')
Rake::TestTask.new(:base_test) do |t|
@@ -33,6 +33,23 @@ task :rubocop do
end
end
namespace :test do
task :migrator_integration do
ENV['LIQUID_MIGRATOR'] = '1'
original_parse_mode = ENV['LIQUID_PARSER_MODE']
begin
Rake::Task['integration_test'].reenable
["lax", "strict"].each do |parse_mode|
ENV['LIQUID_PARSER_MODE'] = parse_mode
Rake::Task['integration_test'].invoke
Rake::Task['integration_test'].reenable
end
ensure
ENV['LIQUID_PARSER_MODE'] = original_parse_mode
end
end
end
desc('runs test suite with both strict and lax parsers')
task :test do
ENV['LIQUID_PARSER_MODE'] = 'lax'