Closed DennisTheMenace780 closed 9 months ago
Note that I have also tried with the Github Actions flow, but i'm still unable to connect:
running 3 tests
test health_check ... ok
test return_400_for_invalid_form_submission ... ok
test subscribe_returns_200_for_valid_form_submission ... FAILED
failures:
---- subscribe_returns_200_for_valid_form_submission stdout ----
thread 'subscribe_returns_200_for_valid_form_submission' panicked at 'Failed to connect to Postgres.: Database(PgDatabaseError { severity: Fatal, code: "28P01", message: "password authentication failed for user \"postgres\"", detail: None, hint: None, position: None, where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: Some("auth.c"), line: Some(335), routine: Some("auth_failed") })', tests/test_health_check.rs:31:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Can you share a link to your project, including the CI files?
After running around in circles for a while I decided to just adopt the Github Actions workflow from Chapter 3 so that I could move forward. Once I have some time this week i'll upload the CircleCI config again and ping you.
One of the big challenges I faced with CircleCI is that I couldn't figure out how to do port mapping. For my project I use port 5069 and map it to 5432
in the Postgres docker container. I have an active Postgres DB already running locally on 5432
so I needed to forward the traffic so that I could also run tests locally against the correct Postgres Container.
I found that with the GH Actions configuration I was able to do that quite easily given how it was made explicit in the file.
At the start of the book I opted to go with CircleCI for my CI pipeline, but as I have worked through Chapter 3 I have noticed that Github Actions are the only supported CI pipeline here. I have been able to kind of get a configuration file set up, but my tests are failing in CI
You'll see below that I am ending up with a database connection problem.
The corresponding test is listed here:
I'm curious if the reason that the test is failing in CI is because i'm not actually filling the database with the data, so
query!()
is unable to make the request.Any thoughts on what could be happening here?