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

test for sql wait strategy #214

Closed
wants to merge 10 commits into from
Closed

Conversation

gianarb
Copy link
Collaborator

@gianarb gianarb commented Jun 16, 2020

The wait.ForSQL wait strategy does not have a testcase and I forgot
about how to use it as well.

I decided to write it in preparation for the work/discussion ongoing
here: #166

@gianarb gianarb added the chore Changes that do not impact the existing functionality label Jun 16, 2020
@gianarb gianarb force-pushed the chore/write-test-for-sql-wait branch from c3728cb to 15d2e8f Compare June 16, 2020 10:17
The wait.ForSQL wait strategy does not have a testcase and I forgot
about how to use it as well.

I decided to write it in preparation for the work/discussion ongoing
here: #166
@gianarb gianarb force-pushed the chore/write-test-for-sql-wait branch from 15d2e8f to 7623f53 Compare June 16, 2020 10:43
mdelapenya
mdelapenya previously approved these changes Aug 14, 2020
Copy link
Collaborator

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM!

wait/sql.go Outdated Show resolved Hide resolved
wait/sql_test.go Outdated Show resolved Hide resolved
@mdelapenya mdelapenya requested a review from a team as a code owner September 29, 2022 16:52
wait/sql.go Outdated Show resolved Hide resolved
wait/sql.go Outdated Show resolved Hide resolved
wait/sql.go Outdated Show resolved Hide resolved
wait/sql.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 29, 2022

Codecov Report

Merging #214 (18f86e4) into main (7d0afb7) will increase coverage by 6.51%.
The diff coverage is 30.43%.

❗ Current head 18f86e4 differs from pull request most recent head 4c77f11. Consider uploading reports for the commit 4c77f11 to get more accurate results

@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
+ Coverage   68.88%   75.40%   +6.51%     
==========================================
  Files          22       23       +1     
  Lines        2144     2500     +356     
==========================================
+ Hits         1477     1885     +408     
+ Misses        528      484      -44     
+ Partials      139      131       -8     
Impacted Files Coverage Δ
testing.go 0.00% <ø> (ø)
wait/sql.go 21.66% <23.52%> (-3.34%) ⬇️
wait/host_port.go 47.47% <40.00%> (-0.95%) ⬇️
compose.go 74.04% <100.00%> (ø)
wait/all.go 0.00% <0.00%> (ø)
container.go 84.40% <0.00%> (+3.68%) ⬆️
docker.go 84.75% <0.00%> (+13.92%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

wait/sql.go Outdated
Comment on lines 93 to 95
db.SetConnMaxLifetime(0)
db.SetMaxIdleConns(3)
db.SetMaxOpenConns(3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Although the code LGTM, I'm a bit reluctant to hardcode this value here without giving the user the ability to set them in the wait strategy, according to their own requirements for the database under test. If we add them as part of the SQL strategy, then I think it's fine.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking about this twice, these settings should be added in a separate PR. Will send a commit on top removing them, and opening a discussion to make this configurable

@mdelapenya mdelapenya closed this Oct 15, 2022
@mdelapenya mdelapenya deleted the chore/write-test-for-sql-wait branch October 15, 2022 06:57
@mdelapenya mdelapenya restored the chore/write-test-for-sql-wait branch October 15, 2022 06:58
@mdelapenya mdelapenya reopened this Oct 15, 2022
@netlify
Copy link

netlify bot commented Mar 9, 2023

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 4c77f11
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/640a0ad618c3780009d9817a
😎 Deploy Preview https://deploy-preview-214--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sonarcloud
Copy link

sonarcloud bot commented Mar 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mdelapenya
Copy link
Collaborator

I think I'm going to close this issue, as it's changing the default timeout values.

I'd reopen it if we receive issues for the wait.ForSQL to fail under low timeout values.

Thanks for your work here.

@mdelapenya mdelapenya closed this Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Changes that do not impact the existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants