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

Integration tests fail (in GOV.UK Docker) #210

Closed
benthorner opened this issue May 14, 2021 · 2 comments
Closed

Integration tests fail (in GOV.UK Docker) #210

benthorner opened this issue May 14, 2021 · 2 comments

Comments

@benthorner
Copy link
Contributor

benthorner commented May 14, 2021

This regression was introduced in: 678ef63

It looks like the new code requires the Mongo DB to be a replica set. The test failures don't give any insight into the cause of the error, probably because the router is being run as a separate binary, and doesn't seem to be logging its errors anywhere.

Example failure:

Redirection
/go/src/github.com/alphagov/router/integration_tests/redirect_test.go:10
  prefix redirects
  /go/src/github.com/alphagov/router/integration_tests/redirect_test.go:71
    should not preserve the query string when redirecting if specified [It]
    /go/src/github.com/alphagov/router/integration_tests/redirect_test.go:106

    Expected
        <string>: 
    to equal
        <string>: /baz

    /go/src/github.com/alphagov/router/integration_tests/redirect_test.go:108

List of more failures:


[Fail] Redirection prefix redirects [It] should not preserve the query string when redirecting if specified 
/go/src/github.com/alphagov/router/integration_tests/redirect_test.go:108

[Fail] Redirection prefix redirects [It] should contain cache headers of 30 mins 
/go/src/github.com/alphagov/router/integration_tests/redirect_test.go:113

[Fail] Redirection prefix redirects [It] should handle path-preserving redirects with special characters 
/go/src/github.com/alphagov/router/integration_tests/redirect_test.go:129

[Fail] Redirection external redirects exact redirect [It] should redirect to the external URL 
/go/src/github.com/alphagov/router/integration_tests/redirect_test.go:146

[Fail] Redirection external redirects exact redirect [It] should not preserve the query string by default 

I get a more informative error if I start the app manually:

router-app_1                                | 2021/05/14 08:39:53 router: listening for refresh on :3055
router-app_1                                | 2021/05/14 08:39:53 router: starting self-update process, polling for route changes every 2s
router-app_1                                | 2021/05/14 08:39:55 router: couldn't get replica set status from MongoDB, skipping update (error: not running with --replSet)

I tried to fix this manually in GOV.UK Docker, and while the app started without errors, the integration tests are still failing for some unknown reason, due to the logs being mysteriously absent.

I think this is equally an issue for anywhere trying to develop this repo without GOV.UK Docker, since the README doesn't provide any specialist instructions about installing or configuring MongoDB.

I'd say this issue is resolved when:

  • We can see error logs from the router when we run integration tests. It may be these are being output somewhere; we could document where they're going, or change the file path so it's more obvious.

  • I can run integration tests in GOV.UK Docker and they pass, with the reasonable exception of the performance tests.

@benthorner
Copy link
Contributor Author

Note that the router build with GOV.UK Docker has been broken for other reasons, as well, so you may need to pull the latest version after the final fix has been added: alphagov/govuk-docker#489.

@sengi
Copy link
Contributor

sengi commented Feb 12, 2024

Dup of alphagov/govuk-docker#591.

It doesn't look like anyone's actually needed to run Router in govuk-docker in the past 3 years or so. We hope to start replacing govuk-docker use cases with Kubernetes soon, so it'll become possible to run end-to-end tests locally.

@sengi sengi closed this as completed Feb 12, 2024
@sengi sengi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2024
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