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

Write a function (to use with diag) to dump server logs on integration test failure #7260

Open
alexgarel opened this issue Aug 26, 2022 · 3 comments
Labels
⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ✅ Task 🧪 tests

Comments

@alexgarel
Copy link
Member

When we have non 200 response while fetching a url in integrations tests, that usually means the servers did encounter an error.

Test::More proposes to use the diag function to add a message in this cases.

We could write an helper function that return last lines of logs files (log4perl etc.) on failure and use diag to display them.

is $response->{_rc}, 200 || diag(get_server_logs())

Even better, we could have a function (called before doing a request) to register log state before the request (how many lines in them), so that get_server_logs returns all lines of logs emitted during the request (so we are sure to capture the log).

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Nov 25, 2022
@alexgarel
Copy link
Member Author

alexgarel commented Nov 25, 2022

We did create a tail_log_start and tail_log_read function in APITest.pm, but right now it's only used in create_user sub. We could use it in other functions.

@github-actions github-actions bot removed the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Nov 26, 2022
Copy link
Contributor

github-actions bot commented Jan 3, 2024

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ✅ Task 🧪 tests
Projects
Status: To discuss and validate
Development

No branches or pull requests

1 participant