Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,33 @@ jobs:

- name: Run Integration Tests
run: |
make test-integration
make test-integration FILTER="not slow and not flaky"

integration-slow-flaky:
runs-on:
- integration
needs: build
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v5

- name: Set up dependencies
run: |
mkdir -p build-artifacts/zephyr/fprime-zephyr-deployment/dict \
&& mv zephyr/fprime-zephyr-deployment/dict/ReferenceDeploymentTopologyDictionary.json build-artifacts/zephyr/fprime-zephyr-deployment/dict
make submodules fprime-venv

- name: Trigger Bootloader
run: |
make bootloader
sleep 10

- name: Copy Firmware
run: |
picotool load ./zephyr.uf2
picotool reboot

- name: Run Integration Tests
run: |
make test-integration FILTER="slow or flaky"
5 changes: 5 additions & 0 deletions FprimeZephyrReference/test/int/antenna_deployer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def configure_antenna_deployer(fprime_test_api: IntegrationTestAPI, start_gds):
fprime_test_api.clear_histories()


@pytest.mark.slow
def test_deploy_without_distance_sensor(fprime_test_api: IntegrationTestAPI, start_gds):
"""Verify the antenna deployer drives the burnwire and reports failure without distance data"""

Expand All @@ -79,6 +80,8 @@ def test_deploy_without_distance_sensor(fprime_test_api: IntegrationTestAPI, sta
assert finish_event.args[1].val == 1, "Exactly one attempt should be recorded"


@pytest.mark.flaky
@pytest.mark.slow
def test_multiple_deploy_attempts(fprime_test_api: IntegrationTestAPI, start_gds):
"""Changes the deploy attempts parameter and ensures the burnwire deploys multiple times"""

Expand Down Expand Up @@ -140,6 +143,7 @@ def test_multiple_deploy_attempts(fprime_test_api: IntegrationTestAPI, start_gds
assert finish_event.args[1].val == 3, "Should have completed 3 attempts"


@pytest.mark.slow
def test_burn_duration_sec(fprime_test_api: IntegrationTestAPI, start_gds):
"""Changes the burn duration sec parameter and ensures the burnwire burns for that long based on the burnwire events"""

Expand Down Expand Up @@ -187,6 +191,7 @@ def test_burn_duration_sec(fprime_test_api: IntegrationTestAPI, start_gds):
assert finish_event.args[0].val == "DEPLOY_RESULT_FAILED"


@pytest.mark.slow
def test_deployment_prevention_after_success(
fprime_test_api: IntegrationTestAPI, start_gds
):
Expand Down
3 changes: 1 addition & 2 deletions FprimeZephyrReference/test/int/drv2605_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ def get_system_power(fprime_test_api: IntegrationTestAPI) -> float:
return power_event.args[0].val


# This test works reliably on hardware driven by a battery, mark as not flaky when CI system is powered by programmable power supply
@pytest.mark.skip("Flaky")
@pytest.mark.flaky
def test_01_magnetorquer_power_draw(fprime_test_api: IntegrationTestAPI, start_gds):
"""Test that magnetorquer powers on by asserting higher power draw"""

Expand Down
2 changes: 2 additions & 0 deletions FprimeZephyrReference/test/int/rtc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def test_01_time_set(fprime_test_api: IntegrationTestAPI, start_gds):
pytest.approx(event_time, abs=30) == datetime.now(timezone.utc)


@pytest.mark.slow
def test_02_time_incrementing(fprime_test_api: IntegrationTestAPI, start_gds):
"""Test that time increments over time"""

Expand Down Expand Up @@ -124,6 +125,7 @@ def test_02_time_incrementing(fprime_test_api: IntegrationTestAPI, start_gds):
)


@pytest.mark.slow
def test_03_time_not_set_event(fprime_test_api: IntegrationTestAPI, start_gds):
"""Test that a TimeNotSet event is emitted when setting time with invalid data"""

Expand Down
4 changes: 4 additions & 0 deletions FprimeZephyrReference/test/int/safe_mode_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def setup_and_teardown(fprime_test_api: IntegrationTestAPI, start_gds):
# ==============================================================================


@pytest.mark.slow
def test_safe_01_initial_safe_mode_reason_is_none(
fprime_test_api: IntegrationTestAPI, start_gds
):
Expand Down Expand Up @@ -176,6 +177,7 @@ def test_safe_01_initial_safe_mode_reason_is_none(
)


@pytest.mark.slow
def test_safe_02_ground_command_sets_reason(
fprime_test_api: IntegrationTestAPI, start_gds
):
Expand Down Expand Up @@ -237,6 +239,7 @@ def test_safe_02_ground_command_sets_reason(
)


@pytest.mark.slow
def test_safe_03_exit_clears_reason(fprime_test_api: IntegrationTestAPI, start_gds):
"""
Test that EXIT_SAFE_MODE clears the safe mode reason to NONE.
Expand Down Expand Up @@ -281,6 +284,7 @@ def test_safe_03_exit_clears_reason(fprime_test_api: IntegrationTestAPI, start_g
)


@pytest.mark.slow
def test_safe_04_no_auto_recovery_for_ground_command(
fprime_test_api: IntegrationTestAPI, start_gds
):
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ test-unit: ## Run unit tests
test-integration: uv ## Run integration tests (set TEST=<name|file.py> or pass test targets)
@DEPLOY="build-artifacts/zephyr/fprime-zephyr-deployment"; \
TARGETS=""; \
FILTER=""; \
if [ -n "$(TEST)" ]; then \
case "$(TEST)" in \
*.py) TARGETS="FprimeZephyrReference/test/int/$(TEST)" ;; \
Expand All @@ -107,7 +108,7 @@ test-integration: uv ## Run integration tests (set TEST=<name|file.py> or pass t
TARGETS="FprimeZephyrReference/test/int"; \
fi; \
echo "Running integration tests: $$TARGETS"; \
$(UV_RUN) pytest $$TARGETS --deployment $$DEPLOY
$(UV_RUN) pytest $$TARGETS --deployment $$DEPLOY -m "$(FILTER)"

# Allow test names to be passed as targets without Make trying to execute them
%:
Expand Down
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
markers =
slow: marks tests as slow
flaky: marks tests as flaky
Loading