Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lane :test do |options|
- only_testing = ["APITests", "ClasspassTests", "UITests"]
- data_dog_time_report = 'test'
- if options[:uitests]
- only_testing = ["UITests"]
- data_dog_time_report = 'uitest'
- end
- clean = options[:clean]
- report_time_elapsed_to_datadog(data_dog_time_report) do
- output_directory = ENV["CIRCLE_ARTIFACTS"] ? ENV["CIRCLE_ARTIFACTS"] : '/tmp/artifacts'
- test_server_output_directory = "#{output_directory}/test-server.log"
- system("mkdir -p #{output_directory}")
- system("touch #{test_server_output_directory}")
- system("node ../../fixture-api/index.js > #{output_directory}/test-server.log &")
- output_file = "#{output_directory}/Development-Development.log"
- begin
- # This is the fastlane command.
- scan(
- workspace: "Classpass.xcworkspace",
- devices: ["iPhone 8"],
- scheme: "Development",
- configuration: "Test",
- output_directory: output_directory,
- buildlog_path: output_directory,
- clean: clean,
- code_coverage: true,
- skip_slack: true,
- only_testing: only_testing,
- include_simulator_logs: false
- )
- report_value_to_datadog("tests.failing", "success")
- rescue => ex
- report_log_lines_to_datadog("tests.failing", output_file, "Test Case '.*' failed")
- report_value_to_datadog("tests.failing", "failure")
- raise "Unit Tests Failed"
- end
- end
- if !options[:uitests]
- sh "bundle exec fastlane coverage report:true"
- end
- end
Add Comment
Please, Sign In to add comment