OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
github_pr_errors: use -i to display screenshots in terminal
Christophe Bliard2d6023adab2c
diff --git a/script/github_pr_errors b/script/github_pr_errorsindex 418f48fc9ef..f2b4fbc92ac 100755--- a/script/github_pr_errors+++ b/script/github_pr_errors@@ -28,6 +28,7 @@ class OptionsDEFAULTS = {compact: false,display_rerun_info: false,+ display_images: false,failed_jobs_logs: [],no_cache: false,run_id: nil,@@ -98,6 +99,10 @@ class Optionsoptions[:failed_jobs_logs] << pathend+ parser.on("-i", "--images", "Download and display screenshots of failed feature tests") do+ options[:display_images] = true+ end+parser.on("-n", "--no-cache", "Do not use cached replies from GitHub API calls") dooptions[:no_cache] = trueend@@ -492,7 +497,25 @@ class Formatterputs escaped_location(error)display_error_attribute("loading error", error.loading_error)display_error_attribute("html", error.page_html)- display_error_attribute("screenshot", error.page_screenshot)+ display_error_screenshot(error.page_screenshot)+ end++ def display_error_screenshot(screenshot_url)+ return unless screenshot_url++ display_error_attribute("screenshot", screenshot_url)+ if Options.display_images+ begin+ Open3.popen2e('imgcat', '--width', '50%', '--url', screenshot_url) do |stdin, stdout_and_stderr, _thread|+ stdin.close+ warn stdout_and_stderr.read+ end+ rescue Errno::ENOENT => e+ warn e+ warn "To display image inline, you need to have a compatible terminal like iTerm2 or Konsole, and the 'imgcat' command installed."+ warn "See https://iterm2.com/documentation-images.html to know more."+ end+ endenddef display_error_attribute(name, value)