Skip to content

Conversation

parapluplu
Copy link
Contributor

This pull requests adds a folder integration_tests that enables us to execute integration tests. The framework automatically spins up an openems edge instance before each test, loads desired configuration files and executes the test.

More infos about how to use the integration tests are in the integration_tests/README.md file.

Prerequisites of this pull request are two other pull requests. For now they are included as commit in here, but since these are changes in OpenEMS components I think it makes sense to review them separately. Once they are merged I'll remove them from this pull request

#3314
#3313

Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 12.50000% with 28 lines in your changes missing coverage. Please review.

❌ Your patch check has failed because the patch coverage (12.50%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3319      +/-   ##
=============================================
- Coverage      59.53%   59.50%   -0.03%     
  Complexity       113      113              
=============================================
  Files           2765     2767       +2     
  Lines         119513   119541      +28     
  Branches        8892     8892              
=============================================
- Hits           71142    71119      -23     
- Misses         45697    45748      +51     
  Partials        2674     2674              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@parapluplu parapluplu force-pushed the hackathon2025/integration_tests branch from ed9e655 to fb32b0b Compare September 18, 2025 12:56
@parapluplu parapluplu changed the title Introduce Integration Tests Introduce integration tests Sep 18, 2025
Felix Remmel added 3 commits September 19, 2025 13:29
For testing it's helpful to set production/consumption data externally
via channel updates. This controller adds this feature

Testing:
```
> curl -d '{"value":6000000}' http://admin:admin@localhost:8084/rest/channel/simulateConsumption/Data
{}
> curl http://admin:admin@localhost:8084/rest/channel/_sum/ConsumptionActivePower
{"address":"_sum/ConsumptionActivePower","type":"INTEGER","accessMode":"RO","text":"","unit":"W","value":6000000}
> curl -d '{"value":1}' http://admin:admin@localhost:8084/rest/channel/simulateConsumption/Data
{}
> curl http://admin:admin@localhost:8084/rest/channel/_sum/ConsumptionActivePower
{"address":"_sum/ConsumptionActivePower","type":"INTEGER","accessMode":"RO","text":"","unit":"W","value":1}
```
Currently the dis/charge limit was based on the capacity. With this change it's configurable.

Testing: Executed `java -jar build/openems-edge.jar` and configured simulated ess with custom dis/charge limits and verified them via using the fixed state of charge controller
Adds a folder integration_tests that enables us to execute integration tests. The framework automatically spins up an openems edge instance before each test, loads desired configuration files and executes the test.

More infos about how to use the integration tests are in the integration_tests/README.md file.

Testing:
run the following once you full filled the requirements mentioned in `integration_tests/README.md`
```
poetry run pytest
> poetry run pytest
============================================================================================= test session starts ==============================================================================================
platform win32 -- Python 3.12.10, pytest-8.4.1, pluggy-1.6.0
rootdir: C:\Users\FelixRemmel\development\original_openems\integration_tests
configfile: pyproject.toml
collected 6 items

openems_integration_tests\tests\edge\ems\power_solver\test_keep_all_equals.py ..                                                                                                                          [ 33%]
openems_integration_tests\tests\edge\ems\test_channel_priorities.py ..                                                                                                                                    [ 66%]
openems_integration_tests\tests\edge\ems\test_smoke_tests.py .                                                                                                                                            [ 83%]
tests\ems_test.py .                                                                                                                                                                                       [100%]

======================================================================================== 6 passed in 223.65s (0:03:43) =========================================================================================
```
@parapluplu parapluplu force-pushed the hackathon2025/integration_tests branch from fb32b0b to 211dc57 Compare September 19, 2025 11:29
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.

1 participant