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

refactor: add observation module #3232

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

steve-chavez
Copy link
Member

@steve-chavez steve-chavez commented Feb 17, 2024

Next steps

  • Move the messages from the Logger to Observation (showObservation).
  • There are more improvements to make but it will involve changing the messages. Wanted to keep the behavior as is for now.

@steve-chavez
Copy link
Member Author

steve-chavez commented Feb 19, 2024

Hm, the only test that is failing is:

def test_log_postgrest_version(defaultenv):
    "Should show the PostgREST version in the logs"

    with run(env=defaultenv) as postgrest:
        version = postgrest.session.head("/").headers["Server"].split("/")[1]

        assert (
            "Starting PostgREST %s..." % version
            in postgrest.process.stdout.readline().decode()
        )
$ postgrest-test-io -k test_log_postgrest_version

test/io/test_io.py::test_log_postgrest_version FAILED                                                                                                                             

Really weird that postgrest-run produces:

$ postgrest-run 
19/Feb/2024:16:11:42 -0500: Starting PostgREST 12.1 (160caaf)

And the io tests don't produce that log line. Is there a difference with postgrest-run? 🤔

@laurenceisla
Copy link
Member

@steve-chavez I think it's the ... which is not included anymore at the end? It should be added to the code or removed from the tests.

According to the CI error, it does log it:

https://github.com/PostgREST/postgrest/actions/runs/7939142788/job/21678864120?pr=3232#step:4:303

AssertionError: assert ('Starting PostgREST %s...' % '12.1 (169c4a6)') in '17/Feb/2024:03:54:48 +0000: Starting PostgREST 12.1 (169c4a6)\n'

@steve-chavez
Copy link
Member Author

Ahh, thanks a lot for that one @laurenceisla. That saved me a lot of time.

According to the CI error, it does log it:

Right, so it's included in the red text then.. that confused me.

@steve-chavez steve-chavez force-pushed the observation-module branch 2 times, most recently from 15d6788 to 0b3e4b8 Compare February 20, 2024 03:32
@steve-chavez steve-chavez marked this pull request as ready for review February 20, 2024 05:26
@steve-chavez
Copy link
Member Author

steve-chavez commented Feb 20, 2024

This looks ready to merge. There are codecov warnings but to clear those we need the recovery tests #1766.

@steve-chavez steve-chavez merged commit 6d506df into PostgREST:main Feb 20, 2024
35 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants