Skip to content

Commit 7eb7f36

Browse files
committed
Updated CHANGELOG and README, added pending changes also
1 parent 0d6ba9e commit 7eb7f36

6 files changed

Lines changed: 31 additions & 16 deletions

File tree

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ This guide helps developers set up, test, and deploy the Flex Net Sim Backend AP
5555
Run the test suite to ensure code quality:
5656

5757
```bash
58-
pytest --cov=backend tests/
58+
pytest --cov=backend --cov=utils tests/
5959
```
6060

6161
## Docker Deployment

.github/workflows/fns-api-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Run tests with coverage
4747
run: |
48-
pytest --cov=backend --cov-report=html tests/
48+
pytest --cov=backend --cov=utils --cov-report=html tests/
4949
5050
- name: Prepare coverage report for GitHub Pages
5151
run: |

CHANGELOG.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### ROADMAP
99
- Switch to new domain.
1010

11+
## [2.0.2] - 2025-03-11
12+
13+
### Added
14+
- Comprehensive unit tests for parameter validation in simulation requests
15+
- Better validation error messages for all simulation parameters
16+
- Helper methods for test assertions to improve code readability
17+
18+
### Changed
19+
- Enhanced test coverage for the helpers module
20+
- Improved test structure with dedicated test methods per parameter
21+
22+
### Fixed
23+
- Edge case handling in parameter validation
24+
25+
1126
## [2.0.1] - 2025-03-04
1227

1328
### Fixed
@@ -88,7 +103,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88103
- Documentation README for the process of develop/deployment located in [workflows](https://github.com/MirkoZETA/FlexNetSim-API/tree/master/.github/workflows/README_DEV.md).
89104

90105
[1.0.0]: https://github.com/MirkoZETA/FlexNetSim-API/releases/tag/v1.0.0
91-
[1.1.0]: https://github.com/MirkoZETA/FlexNetSim-API/releases/tag/v1.1.0
92-
[1.1.1]: https://github.com/MirkoZETA/FlexNetSim-API/releases/tag/pipeline-fix
93-
[2.0.0]: https://github.com/MirkoZETA/FlexNetSim-API/releases/tag/v2.0.0
94-
[2.0.1]: https://github.com/MirkoZETA/FlexNetSim-API/releases/tag/v2.0.1
106+
[1.1.0]: https://github.com/MirkoZETA/FlexNetSim-API/compare/v1.0.0...v1.1.0
107+
[1.1.1]: https://github.com/MirkoZETA/FlexNetSim-API/compare/v1.1.0...pipeline-fix
108+
[2.0.0]: https://github.com/MirkoZETA/FlexNetSim-API/compare/pipeline-fix...v2.0.0
109+
[2.0.1]: https://github.com/MirkoZETA/FlexNetSim-API/compare/v2.0.1...v2.0.0
110+
[2.0.2]: https://github.com/MirkoZETA/FlexNetSim-API/compare/v2.0.2...v2.0.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
![Static Badge](https://img.shields.io/badge/language-python-blue)
55
[![Static Badge](https://img.shields.io/badge/licese-MIT-green)](https://github.com/MirkoZETA/FlexNetSim-API/blob/master/LICENSE)
66
[![Static Badge](https://github.com/MirkoZETA/FlexNetSim-API/actions/workflows/fns-api-workflow.yml/badge.svg)](https://github.com/MirkoZETA/FlexNetSim-API/actions/workflows/fns-api-workflow.yml)
7-
[![Static Badge](https://img.shields.io/badge/coverage-95%25-brightgreen)](https://mirkozeta.github.io/FlexNetSim-API/coverage/)
7+
[![Static Badge](https://img.shields.io/badge/coverage-93%25-brightgreen)](https://mirkozeta.github.io/FlexNetSim-API/coverage/)
88

99
A lightweight API for running optical network simulations with [Flex Net Sim C++](https://gitlab.com/DaniloBorquez/flex-net-sim).
1010

tests/test_compilation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_compilation_failure(self):
2727

2828
# Test with invalid main.cpp file
2929
if os.path.exists("./src/test_main.cpp"):
30-
with temporarily_rename_file("./src/main.cpp", "./src.main.cpp.temp"):
30+
with temporarily_rename_file("./src/main.cpp", "./src/main.cpp.temp"):
3131
with temporarily_rename_file("./src/test_main.cpp", "./src/main.cpp"):
3232
compile_result = compile_simulation(debug=True)
3333
self.assertFalse(compile_result)

tests/test_helpers.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from flask_testing import TestCase
66
from backend import app
77
from utils.helpers import *
8+
from tests.test_utils import temporarily_rename_file
89

910
class TestHelpers(TestCase):
1011
"""Tests for utils functions"""
@@ -15,20 +16,18 @@ def create_app(self):
1516

1617
def test_compile_simulation(self):
1718
# Test compilation failure
18-
os.rename("./src/main.cpp", "./src/main.cpp.temp")
19-
self.assertFalse(compile_simulation(debug=True))
20-
os.rename("./src/main.cpp.temp", "./src/main.cpp")
19+
with temporarily_rename_file("./src/main.cpp", "./src/main.cpp.temp"):
20+
self.assertFalse(compile_simulation(debug=True))
2121

2222
# Test compilation success
2323
self.assertTrue(compile_simulation(debug=True))
2424

2525
def test_validate_simulation_prerequisites(self):
2626
# Test when executable is not found
27-
os.rename("./src/simulation.out", "./src/simulation.out.temp_error")
28-
is_valid, response = validate_simulation_prerequisites()
29-
self.assertFalse(is_valid)
30-
self.assertEqual(response[1], 500)
31-
os.rename("./src/simulation.out.temp_error", "./src/simulation.out")
27+
with temporarily_rename_file("./src/simulation.out", "./src/simulation.out.temp_error"):
28+
is_valid, response = validate_simulation_prerequisites()
29+
self.assertFalse(is_valid)
30+
self.assertEqual(response[1], 500)
3231

3332
# Test when executable is found
3433
self.assertTrue(compile_simulation(debug=True))

0 commit comments

Comments
 (0)