Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests that verify documentation is up-to-date ignore subcommands #152

Open
keynmol opened this issue May 3, 2023 · 1 comment
Open

Tests that verify documentation is up-to-date ignore subcommands #152

keynmol opened this issue May 3, 2023 · 1 comment

Comments

@keynmol
Copy link
Contributor

keynmol commented May 3, 2023

The subcommands docs were out of date because the tests only check the output of the tool as a whole, not individual subcommands: https://github.com/sourcegraph/scip/blob/main/cmd/main_test.go#L26

We should ideally check all of it.

Possible approaches:

  • Extend current one
  • Alternatively, generate the CLI.md entirely out of the tests and use git diff to see if it deviates from what is checked in. Like we do with snapshots
@varungandhi-src
Copy link
Contributor

varungandhi-src commented May 3, 2023

The test does attempt to check the subcommands. https://github.com/sourcegraph/scip/blob/main/cmd/main_test.go#L54-L56

The problem is that for whatever reason (seems like a bug in urfave/cli, I'm pretty sure this was working before... it doesn't work on an earlier commit too 😵‍💫), when running the subcommand with --help, we get an empty string. This means that the substring check passes.

@varungandhi-src varungandhi-src self-assigned this May 3, 2023
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants