Guest User

Untitled

a guest
May 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. lane :test do |options|
  2. only_testing = ["APITests", "ClasspassTests", "UITests"]
  3. data_dog_time_report = 'test'
  4. if options[:uitests]
  5. only_testing = ["UITests"]
  6. data_dog_time_report = 'uitest'
  7. end
  8. clean = options[:clean]
  9. report_time_elapsed_to_datadog(data_dog_time_report) do
  10. output_directory = ENV["CIRCLE_ARTIFACTS"] ? ENV["CIRCLE_ARTIFACTS"] : '/tmp/artifacts'
  11. test_server_output_directory = "#{output_directory}/test-server.log"
  12. system("mkdir -p #{output_directory}")
  13. system("touch #{test_server_output_directory}")
  14. system("node ../../fixture-api/index.js > #{output_directory}/test-server.log &")
  15. output_file = "#{output_directory}/Development-Development.log"
  16. begin
  17. # This is the fastlane command.
  18. scan(
  19. workspace: "Classpass.xcworkspace",
  20. devices: ["iPhone 8"],
  21. scheme: "Development",
  22. configuration: "Test",
  23. output_directory: output_directory,
  24. buildlog_path: output_directory,
  25. clean: clean,
  26. code_coverage: true,
  27. skip_slack: true,
  28. only_testing: only_testing,
  29. include_simulator_logs: false
  30. )
  31. report_value_to_datadog("tests.failing", "success")
  32. rescue => ex
  33. report_log_lines_to_datadog("tests.failing", output_file, "Test Case '.*' failed")
  34. report_value_to_datadog("tests.failing", "failure")
  35. raise "Unit Tests Failed"
  36. end
  37. end
  38. if !options[:uitests]
  39. sh "bundle exec fastlane coverage report:true"
  40. end
  41. end
Add Comment
Please, Sign In to add comment