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

Add Database Replica Integration Tests #1596

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

gsquire
Copy link
Contributor

@gsquire gsquire commented Oct 18, 2024

This patch adds the remaining database replica integration tests. It also corrects some of the parameters for the replica promote test.

Tested with make test_integration.

Closes #1359

This patch adds the remaining database replica integration tests.
It also corrects some of the parameters for the replica promote test.
@gsquire
Copy link
Contributor Author

gsquire commented Oct 18, 2024

I do want to call out the fact that I couldn't find the corresponding API for the replica connection command. So there isn't an integration test for that. I searched for 'replica' here. If someone could help point me in the right direction, I can add it in. Thanks!

@andrewsomething
Copy link
Member

@gsquire Thanks for this great contribution!

I do want to call out the fact that I couldn't find the corresponding API for the replica connection command.

The replica connection command is a bit of an abstraction. There is a not an endpoint that only returns that information. If you look at the implementation, you'll see that we're calling the GET /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME endpoint and just surfacing the connection information.

doctl/do/databases.go

Lines 622 to 631 in 0626468

func (ds *databasesService) GetReplicaConnection(databaseID, replicaID string) (*DatabaseConnection, error) {
rep, err := ds.GetReplica(databaseID, replicaID)
if err != nil {
return nil, err
}
return &DatabaseConnection{
DatabaseConnection: rep.Connection,
}, nil
}

Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

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

👍

@andrewsomething andrewsomething merged commit 1040f20 into digitalocean:main Oct 21, 2024
8 checks passed
@gsquire gsquire deleted the replica-integration-tests branch October 21, 2024 17:20
@gsquire
Copy link
Contributor Author

gsquire commented Oct 21, 2024

The replica connection command is a bit of an abstraction.

Ah, okay. Thanks for reviewing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database Replica Functions Missing Integration Tests
3 participants