Skip to content

Conversation

@julio-lopez
Copy link
Collaborator

@julio-lopez julio-lopez commented Jul 11, 2024

Ensure repository disconnection at the end of the server start CLI command.
This was caught as a result of fixing the test below.

Fix TestServerStartInsecure:
Remove --password=xxx parameter, which causes a server start failure due to incorrect repo password, and not for the case being checked, which is the lack of the --insecure parameter.

Update test comments accordingly.

Removes '--password=xxx' parameter, which causes a server start failure
due to incorrect repo password, and not for the case being checked,
which is the lack of the "--insecure" parameter.
@julio-lopez julio-lopez requested a review from jkowalski July 11, 2024 20:06
@julio-lopez julio-lopez changed the title chore(test): fix TestServerStartInsecure chore(general): fix TestServerStartInsecure Jul 11, 2024
@julio-lopez julio-lopez force-pushed the fix/server-start-test branch from a9185b4 to d1b7a92 Compare July 11, 2024 23:34
@julio-lopez julio-lopez changed the title chore(general): fix TestServerStartInsecure fix(server): ensure repo disconnection at the end of server start Jul 11, 2024
@julio-lopez julio-lopez changed the title fix(server): ensure repo disconnection at the end of server start fix(server): ensure repo disconnection on server start exit Jul 11, 2024
@codecov
Copy link

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 77.25%. Comparing base (cb455c6) to head (06229ed).
Report is 189 commits behind head on master.

Files Patch % Lines
cli/command_server_start.go 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3980      +/-   ##
==========================================
+ Coverage   75.86%   77.25%   +1.39%     
==========================================
  Files         470      481      +11     
  Lines       37301    28806    -8495     
==========================================
- Hits        28299    22255    -6044     
+ Misses       7071     4655    -2416     
+ Partials     1931     1896      -35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@julio-lopez julio-lopez force-pushed the fix/server-start-test branch from d1b7a92 to 06229ed Compare July 12, 2024 00:13
e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--without-password", "--tls-generate-cert")

// server fails to start when TLS is not configured and `--insecure` is not specified
e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the modified test case, see first commit in this PR. It was:

	e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--password=foo")

// server fails to start without a password but with TLS.
e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--tls-generate-cert", "--without-password")
// server fails to start with --without-password when `--insecure` is not specified
e.RunAndExpectFailure(t, "server", "start", "--ui", "--address=localhost:0", "--without-password") // without TLS
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Code movement only to group these cases. This was originally the last case.

@julio-lopez julio-lopez requested a review from redgoat650 July 12, 2024 01:13
@julio-lopez julio-lopez marked this pull request as ready for review July 12, 2024 01:13
@julio-lopez
Copy link
Collaborator Author

@redgoat650 @plar PTAL

@julio-lopez julio-lopez requested a review from plar July 12, 2024 01:25
Copy link
Contributor

@redgoat650 redgoat650 left a comment

Choose a reason for hiding this comment

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

LGTM

@julio-lopez
Copy link
Collaborator Author

@jkowalski FYI

@julio-lopez julio-lopez merged commit ae9f1c7 into kopia:master Jul 12, 2024
@julio-lopez julio-lopez deleted the fix/server-start-test branch July 12, 2024 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants