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

tests for creating HTTPS, IMAP and custom port monitors #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkrivoshein
Copy link

Fixes #21

Copy link
Owner

@bitfield bitfield left a comment

Choose a reason for hiding this comment

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

Nice PR, thank you! A few minor comments below.

This is a very good improvement to the project.

got, err := client.CreateMonitor(create)
if err != nil {
t.Error(err)

Copy link
Owner

Choose a reason for hiding this comment

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

Just a house style tip; I don't use blank lines within functions in this project.


for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Copy link
Owner

Choose a reason for hiding this comment

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

Watch out, there's a subtle bug here: https://gist.github.com/posener/92a55c4cd441fc5e5e85f27bca008721

In fact, we just end up running the Custom port test four times, and none of the others.

for _, tc := range tcs {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
client := New("dummy")
Copy link
Owner

Choose a reason for hiding this comment

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

We should probably move the client setup outside the t.Run() function, shouldn't we?

@mkrivoshein
Copy link
Author

mkrivoshein commented May 7, 2020

Nice PR, thank you! A few minor comments below.

Plan to look into addressing feedback during the next week.

@bitfield
Copy link
Owner

@mkrivoshein how are you getting on? Need any help?

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.

Improve new monitor tests
2 participants