Skip to content

Commit

Permalink
Refactored test for kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
cepages committed Aug 13, 2024
1 parent 3c0ab35 commit d620cb9
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,19 @@ end

desc "Generates Kotlin source code and run its unit tests."
task :test_kotlin do
config_file = File.absolute_path("spec/fixtures/kotlin-tests.yml")
config_file_default = File.absolute_path("spec/fixtures/kotlin-tests.yml")
config_file_no_infer_types = File.absolute_path("spec/fixtures/kotlin-tests_with_no_infer_types.yml")
config_file_array = [config_file_default, config_file_no_infer_types]
dotenv_file = File.absolute_path("spec/fixtures/.env.fruitloops")
directory_to_copy = File.absolute_path("spec/fixtures/kotlin")
with_temp_dir do |temp_dir|
puts "Current working directory: #{temp_dir}"
FileUtils.copy_entry(directory_to_copy, "tests")
sh("ARKANA_RUNNING_CI_INTEGRATION_TESTS=true arkana --lang kotlin --config-filepath #{config_file} --dotenv-filepath #{dotenv_file} --include-environments dev,staging")
Dir.chdir("tests")
sh("./gradlew test")
end
end

desc "Generates Kotlin source code and run its unit tests with no infer types."
task :test_kotlin_with_no_infer_types do
config_file = File.absolute_path("spec/fixtures/kotlin-tests_with_no_infer_types.yml")
dotenv_file = File.absolute_path("spec/fixtures/.env.fruitloops")
directory_to_copy = File.absolute_path("spec/fixtures/kotlin")
with_temp_dir do |temp_dir|
puts "Current working directory: #{temp_dir}"
FileUtils.copy_entry(directory_to_copy, "tests")
sh("ARKANA_RUNNING_CI_INTEGRATION_TESTS=true arkana --lang kotlin --config-filepath #{config_file} --dotenv-filepath #{dotenv_file} --include-environments dev,staging")
Dir.chdir("tests")
sh("./gradlew test")
config_file_array do |config_file|
with_temp_dir do |temp_dir|
puts "Current working directory: #{temp_dir}"
FileUtils.copy_entry(directory_to_copy, "tests")
sh("ARKANA_RUNNING_CI_INTEGRATION_TESTS=true arkana --lang kotlin --config-filepath #{config_file} --dotenv-filepath #{dotenv_file} --include-environments dev,staging")
Dir.chdir("tests")
sh("./gradlew test")
end
end
end

Expand Down

0 comments on commit d620cb9

Please sign in to comment.