Skip to content

chore: add test for enterprise server cli #12353

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

Merged
merged 2 commits into from
Feb 29, 2024
Merged

Conversation

johnstcn
Copy link
Member

To validate that this exercises the code path, add a panic into enterprise/cli/server.go and run the test:

=== RUN   TestServer
=== PAUSE TestServer
=== CONT  TestServer
    clitest.go:75: invoking command: coder --global-config /tmp/TestServer19218759/001 server --in-memory --http-address :40317 --access-url http://example.com
    t.go:99: 2024-02-28 17:00:39.503 [info]  cli: stdout: Started HTTP listener at http://[::]:40317
    t.go:99: 2024-02-28 17:00:39.503 [info]  cli: stdout: View the Web UI: http://example.com
    t.go:99: 2024-02-28 17:00:39.503 [warn]  cli: telemetry disabled, unable to notify of security issues. Read more: https://coder.com/docs/v2/latest/admin/telemetry
    t.go:99: 2024-02-28 17:00:39.504 [info]  cli: stderr: 2024-02-28 17:00:39.503 [warn]  cli: telemetry disabled, unable to notify of security issues. Read more: https://coder.com/docs/v2/latest/admin/telemetry
panic: got here [recovered]
        panic: panic recovered for coder server: got here
FAIL    github.com/coder/coder/v2/enterprise/cli        0.098s
FAIL

@johnstcn johnstcn self-assigned this Feb 28, 2024
@johnstcn johnstcn requested a review from mtojek February 29, 2024 09:51
@johnstcn johnstcn enabled auto-merge (squash) February 29, 2024 09:51
Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

auto-merge was automatically disabled February 29, 2024 09:57

Pull Request is not mergeable

@johnstcn johnstcn enabled auto-merge (squash) February 29, 2024 10:08
@johnstcn johnstcn merged commit 2bf3c72 into main Feb 29, 2024
@johnstcn johnstcn deleted the cj/enterprise-server-test branch February 29, 2024 10:25
@github-actions github-actions bot locked and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants