3tractorrides / release-notes-formatter

MIT License
0 stars 0 forks source link

Sweep: Create an integration test that accepts a mock input.md file and validates the generated output.md file. #7

Closed 3tractorrides closed 10 months ago

3tractorrides commented 10 months ago

Details

Unit Test: Create a new integration test suite that accepts a mock input file, input_mock.py. This integration test simply verifies that the shape of output.md matches what we're expecting. Please use the following as input_mock.md:

## 🏷 Enhancements

- AB-5566 AV Canvas - Aggregate Fixes @kcvikander (#8090)
- AB#5566 - AV Canvas Sorting @kcvikander (#8091)
- AB#5566 Project Shaper Segmented Loading @kcvikander (#8086)
- AB-5767-add-monday-to-settings-integrations @3tractorrides (#8082)
- devops/create-staging-env @3tractorrides (#8087)

## πŸ› Bug Fixes

- AB#5764 Saved views do not show the selected saved view @codeBelt (#8098)

## 🧩 Dependencies

- Update all non-major dependencies @renovate (#8089)

## Requires Feature Flag

- AB#5806 Fix Courier url_domain @codeBelt (#8092)

and use this for output_mock.md:

## 🏷 Enhancements

- [AB#5566](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5566) - AV Canvas - Aggregate Fixes @kcvikander (#8090)
- [AB#5566](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5566) - AV Canvas Sorting @kcvikander (#8091)
- [AB#5566](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5566) - Project Shaper Segmented Loading @kcvikander (#8086)
- [AB#5767](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5767) - add-monday-to-settings-integrations @3tractorrides (#8082)
- devops/create-staging-env @3tractorrides (#8087)

## πŸ› Bug Fixes

- [AB#5764](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5764) - Saved views do not show the selected saved view @codeBelt (#8098)

## 🧩 Dependencies

- Update all non-major dependencies @renovate (#8089)

## Requires Feature Flag

- [AB#5806](https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5806) - Fix Courier url_domain @codeBelt (#8092)
Checklist - [X] Create `input_mock.md` βœ“ https://github.com/3tractorrides/release-notes-formatter/commit/9bd901158909e616919e54fe14f7a1c487d12edc [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/input_mock.md) - [X] Running GitHub Actions for `input_mock.md` βœ“ [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/input_mock.md) - [X] Create `output_mock.md` βœ“ https://github.com/3tractorrides/release-notes-formatter/commit/087adc61544c2479eb99e8c81fd6429a4f0cc077 [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/output_mock.md) - [X] Running GitHub Actions for `output_mock.md` βœ“ [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/output_mock.md) - [X] Modify `test_main.py` βœ“ https://github.com/3tractorrides/release-notes-formatter/commit/213fbb88a3a6929f04c77555573b88217e1addbe [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/test_main.py#L80-L80) - [X] Running GitHub Actions for `test_main.py` βœ“ [Edit](https://github.com/3tractorrides/release-notes-formatter/edit/sweep/create_an_integration_test_that_accepts/test_main.py#L80-L80)
sweep-ai[bot] commented 10 months ago

πŸš€ Here's the PR! #8

See Sweep's progress at the progress dashboard!
⚑ Sweep Basic Tier: I'm using GPT-4. You have 3 GPT-4 tickets left for the month and 1 for the day. (tracking ID: 708a7ef1f1)

For more GPT-4 tickets, visit our payment portal. For a one week free trial, try Sweep Pro (unlimited GPT-4 tickets).

[!TIP] I can email you next time I complete a pull request if you set up your email here!


Actions (click)

GitHub Actionsβœ“

Here are the GitHub Actions logs prior to making any changes:

Sandbox logs for 37eeca5
Checking test_main.py for syntax errors... βœ… test_main.py has no syntax errors! 1/1 βœ“
Checking test_main.py for syntax errors...
βœ… test_main.py has no syntax errors!

Sandbox passed on the latest main, so sandbox checks will be enabled for this issue.


Step 1: πŸ”Ž Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I think are relevant in decreasing order of relevance (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/3tractorrides/release-notes-formatter/blob/37eeca5cd45009016e6645e8476db1b50e38ac74/README.md#L36-L42 https://github.com/3tractorrides/release-notes-formatter/blob/37eeca5cd45009016e6645e8476db1b50e38ac74/test_main.py#L4-L80
I also found the following external resources that might be helpful: **Summaries of links found in the content:** https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5566: The page is titled "Azure DevOps Services | Sign In" and the content mentions that Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled, which may prevent web integration experiences from displaying or performing correctly. It suggests disabling this configuration or contacting the administrator to continue with the operation. The problem details provided by the user are unrelated to the content of the page. https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5806: The page is titled "Azure DevOps Services | Sign In" and the content mentions that Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled, which may prevent web integration experiences from displaying or performing correctly. It suggests disabling this configuration or contacting the administrator to continue with the operation. The problem details provided by the user are unrelated to the content of the page. https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5764: The page is titled "Azure DevOps Services | Sign In" and the content mentions that Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled, which may prevent web integration experiences from displaying or performing correctly. It suggests disabling this configuration or contacting the administrator to continue with the operation. The problem details provided by the user are unrelated to the content of the page. https://dev.azure.com/parallax-app/Parallax%202023/_workitems/edit/5767: The page is titled "Azure DevOps Services | Sign In" and the content mentions that Microsoft Internet Explorer's Enhanced Security Configuration is currently enabled, which may prevent web integration experiences from displaying or performing correctly. It suggests disabling this configuration or contacting the administrator to continue with the operation. The problem details provided by the user are unrelated to the content of the page.

Step 2: ⌨️ Coding

Ran GitHub Actions for 9bd901158909e616919e54fe14f7a1c487d12edc:

Ran GitHub Actions for 087adc61544c2479eb99e8c81fd6429a4f0cc077:

--- 
+++ 
@@ -1,4 +1,9 @@
 import re
+import os
+import filecmp
+import shutil
+import os
+import filecmp
 import unittest
 from main import format_ticket_number_list, build_release_item_text

@@ -76,6 +81,13 @@
     #     transformed_content = build_release_item_text(input_string, base_url)
     #     self.assertEqual(transformed_content, expected_output)

+class TestIntegration(unittest.TestCase):
+    def test_integration(self):
+        shutil.copyfile('input_mock.md', 'input.md')
+        os.system('python3 main.py')
+        self.assertTrue(filecmp.cmp('output.md', 'output_mock.md'), "Output file does not match the expected output.")
+
 if __name__ == '__main__':
     unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(TestFormatTicketNumberList))
     unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(TestBuildReleaseItemText))
+    unittest.TextTestRunner().run(unittest.TestLoader().loadTestsFromTestCase(TestIntegration))

Ran GitHub Actions for 213fbb88a3a6929f04c77555573b88217e1addbe:


Step 3: πŸ” Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/create_an_integration_test_that_accepts.


πŸŽ‰ Latest improvements to Sweep:


πŸ’‘ To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord