From a1ce6029c13ab69ae6e7d08a8f9593435abb5b92 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 12 Jan 2024 20:14:26 +1100 Subject: [PATCH] Pass -f as single arg in integration test For some bizarre reason `pkg/integration/tests/filter_by_path/cli_arg.go` is failing as of 8c716184 like so: ``` test_lazygit Usage: test_lazygit [git-arg] Positional Variables: git-arg Panel to focus upon opening lazygit. Accepted values (based on git terminology): status, branch, log, stash. Ignored if --filter arg is passed. Flags: -h --help Displays help with available flag, subcommand, and positional value parameters. -p --path Path of git repo. (equivalent to --work-tree= --git-dir=/.git/) -f --filter Path to filter on in `git log -- `. When in filter mode, the commits, reflog, and stash are filtered based on the given path, and some operations are restricted -v --version Print the current version -d --debug Run in debug mode with logging (see --logs flag below). Use the LOG_LEVEL env var to set the log level (debug/info/warn/error) (default: false) -l --logs Tail lazygit logs (intended to be used when `lazygit --debug` is called in a separate terminal tab) -c --config Print the default config -cd --print-config-dir Print the config directory -ucd --use-config-dir override default config directory with provided directory -w --work-tree equivalent of the --work-tree git argument -g --git-dir equivalent of the --git-dir git argument -ucf --use-config-file Comma separated list to custom config file(s) Unknown arguments supplied: filterFile ``` where the CLI args are: ``` ([]string) (len=5 cap=5) { (string) (len=25) "/tmp/lazygit/test_lazygit", (string) (len=6) "-debug", (string) (len=108) "--use-config-dir=/Users/jesseduffieldduffield/repos/lazygit/test/_results/filter_by_path/cli_arg/used_config", (string) (len=2) "-f", (string) (len=10) "filterFile" } ``` This appears to be a bug in flaggy itself. I've updated to the latest version but it still breaks. Bizarrely it works fine on CI and only fails locally. Running lazygit locally with `lg -f pkg/gui/controllers/helpers/refresh_helper.go` it works fine. So I don't know what's going on there. At any rate, I'm just going to get the test passing by passing `-f=filterFile` as a single argument. --- pkg/integration/tests/filter_by_path/cli_arg.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/integration/tests/filter_by_path/cli_arg.go b/pkg/integration/tests/filter_by_path/cli_arg.go index de368c17d..5b3912829 100644 --- a/pkg/integration/tests/filter_by_path/cli_arg.go +++ b/pkg/integration/tests/filter_by_path/cli_arg.go @@ -7,7 +7,7 @@ import ( var CliArg = NewIntegrationTest(NewIntegrationTestArgs{ Description: "Filter commits by file path, using CLI arg", - ExtraCmdArgs: []string{"-f", "filterFile"}, + ExtraCmdArgs: []string{"-f=filterFile"}, Skip: false, SetupConfig: func(config *config.AppConfig) { },