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

carddav: end-to-end test address book discovery #96

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

bitfehler
Copy link
Collaborator

As the implementation evolves, it will be necessary to have more tests
to assert we don't break anything when making changes. This commit
introduces a test setup to test that server and client can handle the
address book discovery with various parameters. The test setup should be
easily extendable to cover even more ground as needed.

@bitfehler
Copy link
Collaborator Author

I created this mostly for #87 but I think it would be useful to have something like this for all sorts of reasons. I can of course do the same thing for carddav and even one for a combined server. But as usual, I wanted to get your feedback early on, as it usually proves to be very valuable 🙂

If you think it makes sense I would also extend the test function to at least list all contacts and explicitly retrieve one (well, the only) test contact.

carddav/carddav_test.go Outdated Show resolved Hide resolved
}

func TestAddressBookDiscovery(t *testing.T) {

Copy link
Owner

Choose a reason for hiding this comment

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

Style nit: stray newline

carddav/carddav_test.go Show resolved Hide resolved
addressBookPath: "/contacts/",
},
{
name: "explicit-well-known",
Copy link
Owner

Choose a reason for hiding this comment

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

Hm, I'm not sure this is an accurate test case name, the CardDAV backend has no say in what the well-known URI is. Maybe "separate-principal" would be a better name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree, but "separate-principal" is also true for the previous case. I called it nothing-at-root, as this is the distinctive feature of this case. Does that work?

carddav/carddav_test.go Show resolved Hide resolved
carddav/carddav_test.go Outdated Show resolved Hide resolved
carddav/carddav_test.go Show resolved Hide resolved
carddav/carddav_test.go Show resolved Hide resolved
As the implementation evolves, it will be necessary to have more tests
to assert we don't break anything when making changes. This commit
introduces a test setup to test that server and client can handle the
address book discovery with various parameters. The test setup should be
easily extendable to cover even more ground as needed.
Copy link
Owner

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Thanks!

@emersion emersion merged commit 4a3cd05 into emersion:master Jul 13, 2022
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.

None yet

2 participants