Skip to content

Conversation

@Askir
Copy link
Contributor

@Askir Askir commented Dec 12, 2025

This also changes to prefer the TIGER_CONFIG_DIR env var over the keyring if it is set.
This was necessary to give an option for the integration test not use the system keyring, but I think it generally makes sense to do this?

Output looks like this:

go test ./internal/tiger/cmd -v -run TestDbConnectPasswordResetIntegration -timeout 30m
=== RUN   TestDbConnectPasswordResetIntegration
Set api_url = https://console.cloud.timescale.com/public/api/v1
    integration_test.go:2047: Using temporary config directory: /var/folders/db/hb2zr45j3l3btft0bv249vhm0000gn/T/tiger-integration-test-1023195604
=== RUN   TestDbConnectPasswordResetIntegration/Login
    integration_test.go:2083: Logging in with public key: 01KC6QNV...
=== RUN   TestDbConnectPasswordResetIntegration/CreateService
    integration_test.go:2103: Creating service for password reset test
    integration_test.go:2119: Created service with ID: baodc92dti
=== NAME  TestDbConnectPasswordResetIntegration
    integration_test.go:2124: Built tiger binary at: /var/folders/db/hb2zr45j3l3btft0bv249vhm0000gn/T/tiger-integration-test-1023195604/tiger
=== RUN   TestDbConnectPasswordResetIntegration/SubprocessLogin
    integration_test.go:2129: Running tiger auth login in subprocess environment
    integration_test.go:2140: Subprocess auth login output: Validating API key...
        Successfully logged in (project: wyuqu2ystg)

        🎉 Next steps:
        • Install MCP server for your favorite AI coding tool: tiger mcp install
        • List existing services: tiger service list
        • Create a new service: tiger service create
=== RUN   TestDbConnectPasswordResetIntegration/VerifyInitialConnection
    integration_test.go:2148: Verifying initial connection works before deleting password
    integration_test.go:2173: Waiting for psql prompt...
psql (14.18 (Homebrew), server 17.7 (Ubuntu 17.7-3.pgdg22.04+1))
WARNING: psql major version 14, server major version 17.
         Some psql features might not work.
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

tsdb=>    integration_test.go:2178: Got psql prompt - connection works!
    integration_test.go:2184: Initial connection verified successfully
=== RUN   TestDbConnectPasswordResetIntegration/DeleteStoredPassword
    integration_test.go:2192: Deleting stored password to trigger recovery flow
    integration_test.go:2227: Password removed from storage
=== RUN   TestDbConnectPasswordResetIntegration/InteractivePasswordReset
    integration_test.go:2235: Running interactive password reset flow
    integration_test.go:2259: Waiting for menu prompt...
Warning: could not retrieve stored password: no matching entry found in .pgpass file
failed to connect to `user=tsdbadmin database=tsdb`: 3.231.107.230:32894 (baodc92dti.wyuqu2ystg.tsdb.cloud.timescale.com): failed SASL auth: FATAL: password authentication failed for user "tsdbadmin" (SQLSTATE 28P01)
Stored password is likely invalid or expired.

What would you like to do?    integration_test.go:2264: Got menu prompt
    integration_test.go:2267: Selecting option 2 (Update/reset password)
    integration_test.go:2271: Waiting for password prompt...


  1. Enter password manually
> 2. Update/reset password
  3. Exit

Enter new password    integration_test.go:2276: Got password prompt
    integration_test.go:2279: Sending empty password to auto-generate
    integration_test.go:2283: Waiting for success message...
 (leave empty to generate):
Successfully generated a new password.
Password saved to ~/.pgpass for automatic authentication
To view your new password, run:
	 tiger service get baodc92dti --with-password
✅ Master password for 'tsdbadmin' user updated successfully    integration_test.go:2288: Got success message
    integration_test.go:2291: Waiting for psql to launch...
    integration_test.go:2296: Sending \q to exit psql
    integration_test.go:2305: Interactive password reset completed
=== RUN   TestDbConnectPasswordResetIntegration/VerifyPasswordReset
    integration_test.go:2313: Verifying password was reset successfully
    integration_test.go:2330: Password reset verified - connection successful
=== RUN   TestDbConnectPasswordResetIntegration/DeleteService
    integration_test.go:2338: Deleting service: baodc92dti
    integration_test.go:2353: Service deleted successfully
=== NAME  TestDbConnectPasswordResetIntegration
    integration_test.go:2059: Cleaning up authentication
--- PASS: TestDbConnectPasswordResetIntegration (65.10s)
    --- PASS: TestDbConnectPasswordResetIntegration/Login (0.56s)
    --- PASS: TestDbConnectPasswordResetIntegration/CreateService (51.77s)
    --- PASS: TestDbConnectPasswordResetIntegration/SubprocessLogin (0.85s)
    --- PASS: TestDbConnectPasswordResetIntegration/VerifyInitialConnection (2.91s)
    --- PASS: TestDbConnectPasswordResetIntegration/DeleteStoredPassword (0.33s)
    --- PASS: TestDbConnectPasswordResetIntegration/InteractivePasswordReset (4.37s)
    --- PASS: TestDbConnectPasswordResetIntegration/VerifyPasswordReset (1.30s)
    --- PASS: TestDbConnectPasswordResetIntegration/DeleteService (1.45s)
PASS
ok  	github.com/timescale/tiger-cli/internal/tiger/cmd	(cached)

@Askir Askir marked this pull request as ready for review December 16, 2025 14:14
@Askir Askir force-pushed the jascha/age-311-tiger-cli-investigate-interactive-testing-via-go-expect branch from 58b5d75 to 26cacde Compare December 17, 2025 06:28
@Askir Askir changed the title Draft: Add go-expect based integration test for password resets Add go-expect based integration test for password resets Dec 18, 2025
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