test: full width for CI testing [ci skip]
Also clean up the .env.sample.
This commit is contained in:
		| @ -1,7 +1,7 @@ | ||||
| go env -w GOPRIVATE=coopcloud.tech | ||||
|  | ||||
| # export PASSWORD_STORE_DIR=$(pwd)/../../autonomic/passwords/passwords/ | ||||
|  | ||||
| # integration test suite | ||||
| # export ABRA_DIR="$HOME/.abra_test" | ||||
| # export ABRA_TEST_DOMAIN=test.example.com | ||||
| # export ABRA_SKIP_TEARDOWN=1 # for faster feedback when developing tests | ||||
| # export ABRA_CI=1 | ||||
|  | ||||
| # release automation | ||||
| # export GITEA_TOKEN= | ||||
|  | ||||
| @ -4,6 +4,7 @@ import ( | ||||
| 	"bytes" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"os" | ||||
| 	"strings" | ||||
| 	"time" | ||||
|  | ||||
| @ -42,22 +43,33 @@ func HumanDuration(timestamp int64) string { | ||||
|  | ||||
| // CreateTable prepares a table layout for output. | ||||
| func CreateTable() (*table.Table, error) { | ||||
| 	table := table.New(). | ||||
| 		Border(lipgloss.ThickBorder()). | ||||
| 		BorderStyle( | ||||
| 			lipgloss.NewStyle(). | ||||
| 				Foreground(lipgloss.Color("63")), | ||||
| 		) | ||||
|  | ||||
| 	if isAbraCI, ok := os.LookupEnv("ABRA_CI"); ok && isAbraCI == "1" { | ||||
| 		// NOTE(d1): no width limits for CI testing since we test against outputs | ||||
| 		log.Debug("detected ABRA_CI=1") | ||||
| 		return table, nil | ||||
| 	} | ||||
|  | ||||
| 	width, _, err := term.GetSize(0) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	if width-10 < 79 { | ||||
| 		width = 79 | ||||
| 		// NOTE(d1): maintain standard minimum width | ||||
| 		table.Width(79) | ||||
| 	} else { | ||||
| 		// NOTE(d1): tests show that this produces stable border drawing | ||||
| 		table.Width(width - 10) | ||||
| 	} | ||||
|  | ||||
| 	return table.New(). | ||||
| 		Width(width - 10). | ||||
| 		Border(lipgloss.ThickBorder()). | ||||
| 		BorderStyle( | ||||
| 			lipgloss.NewStyle(). | ||||
| 				Foreground(lipgloss.Color("63")), | ||||
| 		), nil | ||||
| 	return table, nil | ||||
| } | ||||
|  | ||||
| // ToJSON converts a lipgloss.Table to JSON representation. It's not a robust | ||||
|  | ||||
| @ -72,6 +72,7 @@ echo "========================================================================" | ||||
| export ABRA_DIR="$HOME/.abra_test" | ||||
| export TERM=xterm | ||||
| export TEST_SERVER=default | ||||
| export ABRA_CI=1 | ||||
|  | ||||
| rm -rf "$ABRA_DIR" | ||||
| bats -Tp tests/integration --filter-tags \!dns --print-output-on-failure | ||||
|  | ||||
		Reference in New Issue
	
	Block a user