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

Fix tests that rely on behavior of external domains #112

Open
nharper opened this issue Jul 3, 2019 · 4 comments
Open

Fix tests that rely on behavior of external domains #112

nharper opened this issue Jul 3, 2019 · 4 comments

Comments

@nharper
Copy link
Collaborator

nharper commented Jul 3, 2019

Some of the test cases in redirects_test.go and domain_test.go rely on the behavior of external domains. For some of these tests, that behavior has changed and the tests are no longer passing.

Preferably, the tests would be hermetic and not connect to any external sites. If that's not possible, I'd prefer restricting it to domains where we have some reasonable assurance that it will keep behaving the way we expect for a test (e.g. badssl.com).

@nharper
Copy link
Collaborator Author

nharper commented Jul 3, 2019

(See also issue #75)

@lgarron
Copy link
Collaborator

lgarron commented Jul 3, 2019

I drafted a fix for this a while back! I'll go dust it off.

@nharper
Copy link
Collaborator Author

nharper commented Jul 8, 2019

That sounds incredibly useful, even if it's only partially complete.

@lgarron
Copy link
Collaborator

lgarron commented Jul 9, 2019

Here's the part I was able to dig up: d4e2a71

The idea was to have a JSON file mapping URLs to http.DumpResponse() values, and ideally a "record" mode to add missing URLs to the cache while running the test. It's not super-idiomatic Go, bu I was unable to find an idiomatic Go testing mechanism for this (at the time) and this idea seemed simplest to implement and understand.

I have to apologize for the state of the code, though. It's even more incomplete than I remember, and I don't have time to work on it right now. It should give you a rough idea how how to hook up a custom transport for testing, though.

This was referenced Jun 5, 2020
phumpal added a commit to phumpal/sensu-plugins-ssl that referenced this issue Jun 6, 2020
At the moment this test looks dead in the water and probably won't be
moved foward due to bandwidth. I could dig and figure it out but I think
fixing Chromium bugs is out of scope.

I've removed the failing test for now.

Please see chromium/hstspreload#112 for
further info.
nharper added a commit to nharper/hstspreload that referenced this issue Jun 29, 2023
These tests should be fixed
(chromium#112); in the meantime
disable them so that `make test` passes.
nharper added a commit to nharper/hstspreload that referenced this issue Jun 29, 2023
These tests should be fixed
(chromium#112); in the meantime
disable them so that `make test` passes.
carlosjoan91 pushed a commit that referenced this issue Jun 30, 2023
These tests should be fixed
(#112); in the meantime
disable them so that `make test` passes.
nharper added a commit to nharper/hstspreload that referenced this issue Jul 12, 2023
Like PR chromium#131, these tests should be fixed as part of issue chromium#112, but in
the meantime disabling them so that `make test` passes.
nharper added a commit that referenced this issue Jul 12, 2023
Like PR #131, these tests should be fixed as part of issue #112, but in
the meantime disabling them so that `make test` passes.
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

No branches or pull requests

2 participants