Skip to content

GitHub cli tests incompatible with latest Glamour v0.8.0 #10179

@ottok

Description

@ottok

Description

Latest version of https://github.com/charmbracelet/glamour, which GitHub cli depends on, has slightly different behavior in whitespace and line width, which makes tests fail. The correct fix is to simply modify the tests slightly. There is no actual bug, end result for GitHub cli users is still correct before and after.

Steps to reproduce the behavior

  1. Update build dependency Glamour to v0.8.0
  2. Build

Expected vs actual behavior

Build and post-build test suite should pass.

However, with Glamour v0.8.0 they start failing. One example below.

Logs

=== RUN   TestPRReview_interactive
     review_test.go:283: 
         	Error Trace:	/<<PKGBUILDDIR>>/_build/src/github.com/cli/cli/v2/pkg/cmd/pr/review/review_test.go:283
         	Error:      	Not equal: 
         	            	expected: "Got:\n\n  cool story                                                                  \n\n"
         	            	actual  : "Got:\n\n  cool story                                                                      \n\n"
         	            	
         	            	Diff:
         	            	--- Expected
         	            	+++ Actual
         	            	@@ -2,3 +2,3 @@
         	            	 
         	            	-  cool story                                                                  
         	            	+  cool story                                                                      
         	            	 
         	Test:       	TestPRReview_interactive
 --- FAIL: TestPRReview_interactive (0.00s)

Solution

Merge #10151.

Additional details

The original error was reported in Debian in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1091585 and fixed in https://salsa.debian.org/go-team/packages/gh/-/commit/8faccf149d0836f8ff285808182c15cf02dd9f28 that was included in the latest upload the Debian unstable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageneeds to be reviewedneeds-user-inputtech-debtA chore that addresses technical debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions