slackapi / slackapi/slack-cli

Tests fail when using fish (and possibly other shells)

Open
#462 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build code health
Dominant language
Go
Stars
305
Forks
46
Avg merge
1d 11h
Merged PRs (30d)
23

Description

Description

When attempting to run tests under fish, the following errors are incorrectly thrown:

--- FAIL: TestDeployCommand_DeployHook (11.06s)
    --- FAIL: TestDeployCommand_DeployHook/fails_to_execute_an_unknown_script_path (2.31s)
        deploy_test.go:294:
                Error Trace:    github.com/slackapi/slack-cli/cmd/platform/deploy_test.go:294
                Error:          Should be true
                Test:           TestDeployCommand_DeployHook/fails_to_execute_an_unknown_script_path
    --- FAIL: TestDeployCommand_DeployHook/echos_stderr_output_to_standard_err (2.20s)
        deploy_test.go:296:
                Error Trace:    github.com/slackapi/slack-cli/cmd/platform/deploy_test.go:296
                Error:          Received unexpected error:
                                Error running 'Deploy' command: exit status 127 (sdk_hook_invocation_failed)

                                Suggestion
                                   Run `platform.test doctor` to check that your system dependencies are up-to-date.
                Test:           TestDeployCommand_DeployHook/echos_stderr_output_to_standard_err
FAIL
FAIL    github.com/slackapi/slack-cli/cmd/platform      11.953s

This seems to be due to a dependency on particular shell syntax/messages in the tests.

Version

Using slack-cli v3.15.0

OS Info

Arch Linux (under WSL2)

Steps to reproduce:

Share the commands to run, source code, and project settings:

  1. Build.
  2. go test ./...
Expected result:

I expected the tests to pass.

Actual result:

The tests failed, as shown above.

Requirements
  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with cmd/platform/deploy_test.go, especially TestDeployCommand_DeployHook and the failing cases at lines 294 and 296. Run go test ./... under fish, inspect the shell syntax and expected messages used by these tests, and consider the work done when the deploy hook tests pass without shell-specific failures.

Written by the indexing model from the issue text.

Assessment

Tech stack
fish, go
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.