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

Slombard/web 286 fix test for parallel requests to the cgi #385

Merged

Conversation

552020
Copy link
Collaborator

@552020 552020 commented May 21, 2024

From yesterday.

Copy link

linear bot commented May 21, 2024

@dantol29
Copy link
Owner

@552020 Can you modify your tester a bit and it to git actions?

@552020
Copy link
Collaborator Author

552020 commented May 22, 2024

@552020 Can you modify your tester a bit and it to git actions?

Is it now working? I

Are we sure that the problem of the blocking behaviour of the read of the pipe in the CGI is due to the not closed pipe in the child process?

Tagging also @lmangall since it's CGI.

@dantol29
Copy link
Owner

@552020 I wrote why it did not work in Slack. And yes, tests are working now

@552020
Copy link
Collaborator Author

552020 commented May 22, 2024

@dantol29 Tests are now passing.

@552020 552020 requested review from dantol29 and lmangall May 22, 2024 21:27
@552020 552020 self-assigned this May 22, 2024
@dantol29
Copy link
Owner

@552020 But is parallel cgi test checking properly this time?

@552020
Copy link
Collaborator Author

552020 commented May 22, 2024

@552020 But is parallel cgi test checking properly this time?

Yes, the problem before was that the connection was timing out before the cgi returned the page. But if it will fail it will not display an error.

@dantol29
Copy link
Owner

@552020 What is the purpose of the test if it doesn't display an error?

@552020
Copy link
Collaborator Author

552020 commented May 23, 2024

@552020 What is the purpose of the test if it doesn't display an error?

The purpose of a test, even if it doesn't display an error, is multifaceted and includes several key objectives:

  1. Validation of Correctness: The primary goal of a test is to confirm that the software behaves as expected. If a test doesn't display an error, it means the code passed the test conditions and is functioning correctly within the specified parameters.

  2. Regression Prevention: Tests help ensure that new changes or additions to the codebase do not introduce new bugs or break existing functionality. A passing test indicates that the recent changes did not negatively impact the tested features.

  3. Documentation: Tests serve as a form of documentation for the codebase. They provide examples of how the code is expected to be used and what outputs are expected for given inputs. This helps new developers understand the expected behavior of the code.

  4. Confidence in Code Changes: When tests pass, developers can be more confident that their changes are correct and that the system is stable. This is particularly important in continuous integration and continuous deployment environments where code is frequently merged and deployed.

  5. Specification Confirmation: Tests can confirm that the code adheres to the specifications or requirements outlined for the project. A passing test means the code meets the specific criteria that were defined.

  6. Quality Assurance: Automated tests contribute to the overall quality assurance process by consistently checking the code against defined criteria. This helps maintain a high standard of quality throughout the development lifecycle.

  7. Detecting Edge Cases: Tests can be designed to cover edge cases and uncommon scenarios that may not be obvious during regular usage. Passing these tests ensures the code can handle a wide range of inputs and situations.

  8. Refactoring Support: When refactoring code, tests help ensure that changes do not alter the expected behavior. A passing test suite provides reassurance that the refactored code is still correct.

In summary, the absence of errors in test results is a positive outcome, indicating that the software is functioning as intended. This contributes to a robust and reliable codebase, enabling developers to make changes and additions with greater confidence.

552020 added 2 commits May 23, 2024 10:35
… commenting out a print which cause an onverflow on mac
We had to change the way the error is checked - we write the error in a file cause for the async nature of the operation the error variable was not correctly read
@552020
Copy link
Collaborator Author

552020 commented May 23, 2024

@dantol29 now I fixed it. The test will return 1 and not 0 if the test is failing. Pushing this version with a sleep bigger than the CGI timout to let the test fail and check if it fails. On my machine is working, you see the 0 and the 1 with echo $? after I changed the script.

image

@552020
Copy link
Collaborator Author

552020 commented May 23, 2024

image

Copy link
Owner

@dantol29 dantol29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGtM!

@dantol29 dantol29 merged commit 1a26343 into main May 23, 2024
2 checks passed
@552020 552020 deleted the slombard/web-286-fix-test-for-parallel-requests-to-the-cgi branch May 23, 2024 09:25
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

Successfully merging this pull request may close these issues.

2 participants