From d2af3a03b73f027796727e5daf579f21eab718dc Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:03:47 +0000 Subject: [PATCH 1/3] feat/fix: the commit message --- tests/test_file.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/test_file.py diff --git a/tests/test_file.py b/tests/test_file.py new file mode 100644 index 00000000000..2e295ba9496 --- /dev/null +++ b/tests/test_file.py @@ -0,0 +1,44 @@ +import pytest +from my_module import MyClass + + +class TestFailingScenarios: + def test_scenario1(self): + # Test case for failing scenario 1 + # Set up test data + my_obj = MyClass() + + # Call the function or method causing the failure + result = my_obj.some_method() + + # Assert the expected result + assert result == expected_result + + def test_scenario2(self): + # Test case for failing scenario 2 + # Set up test data + my_obj = MyClass() + + # Call the function or method causing the failure + result = my_obj.another_method() + + # Assert the expected result + assert result == expected_result + + # Add more test cases for other failing scenarios + + def test_edge_case(self): + # Test case for an edge case scenario + # Set up test data + my_obj = MyClass() + + # Call the function or method causing the failure + result = my_obj.edge_case() + + # Assert the expected result + assert result == expected_result + + # Add more test cases for other edge cases + +if __name__ == "__main__": + pytest.main() From af713ad62257feae2dcd8471ac7939e7c30bd87a Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:04:49 +0000 Subject: [PATCH 2/3] feat: Updated tests/test_file.py --- tests/test_file.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_file.py b/tests/test_file.py index 2e295ba9496..54bc516aa10 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -9,7 +9,7 @@ def test_scenario1(self): my_obj = MyClass() # Call the function or method causing the failure - result = my_obj.some_method() + result = my_obj.failure_scenario_1() # Assert the expected result assert result == expected_result @@ -20,7 +20,7 @@ def test_scenario2(self): my_obj = MyClass() # Call the function or method causing the failure - result = my_obj.another_method() + result = my_obj.failure_scenario_2() # Assert the expected result assert result == expected_result @@ -33,7 +33,7 @@ def test_edge_case(self): my_obj = MyClass() # Call the function or method causing the failure - result = my_obj.edge_case() + result = my_obj.edge_case_failure() # Assert the expected result assert result == expected_result From 8d6ea34d5eabb03abbff0540f1e98d12200bcca2 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 15:05:34 +0000 Subject: [PATCH 3/3] feat: Updated CONTRIBUTING.md --- CONTRIBUTING.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c5f06665492..5939fe3577f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,6 +28,14 @@ Please follow our README for [instructions on installing from source](https://gi ## Style guide +### Identifying and Addressing Failing Tests + +Before submitting any contributions, please ensure that you follow the guidelines below to address failing tests and write new tests to cover the failing scenarios: + +1. Check the status of the test suite on your local machine to identify any failing tests. +2. If any failing tests are identified, write new tests to cover the failing scenarios. +3. Ensure that the full test suite, including your test additions or changes, passes successfully before opening a pull request. + Before submitting any contributions, please ensure that it adheres to our [Style Guide](docs/StyleGuide.md). @@ -69,7 +77,7 @@ cd timescaledb This will be recognized by GitHub. It will close the corresponding issue and place a hyperlink under the number. -* Push your changes to an upstream branch: +* Push your changes to an upstream branch and address any failing tests in the CI: * Make sure that each commit in the pull request will represent a logical change to the code, will compile, and will pass tests. @@ -102,7 +110,7 @@ cd timescaledb * If you get a test failure in the CI, check them under [Github Actions](https://github.com/timescale/timescaledb/actions) * Address feedback by amending your commit(s). If your change contains - multiple commits, address each piece of feedback by amending that + multiple commits, address each piece of feedback by amending that commit to address the failing tests in the CI. commit to which the particular feedback is aimed. * The PR is marked as accepted when the reviewer thinks it's ready to be @@ -132,7 +140,11 @@ cd build && make make installcheck ``` -All submitted pull requests are also automatically +All submitted pull requests are also automatically tested in the CI via [Github Actions](https://github.com/timescale/timescaledb/actions) to identify failing tests and failing scenarios. + +### Identifying Failing Tests and Writing New Tests + +Before opening a pull request, check the status of the test suite on your local machine to identify any failing tests. If any failing tests are identified, write new tests to cover the failing scenarios. Ensure that the full test suite, including your test additions or changes, passed successfully before opening a pull request. run against our test suite via [Github Actions](https://github.com/timescale/timescaledb/actions) (that link shows the latest build status of the repository).