[TEMP] Skip camera_handler_test.py#408
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe integration test ChangesCamera Test Skip Configuration
Estimated Code Review Effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@PROVESFlightControllerReference/test/int/camera_handler_test.py`:
- Line 28: Replace the unconditional skip on test_01_take_image with a CI-only
conditional skip: import os in the test module and replace
`@pytest.mark.skip`(...) on test_01_take_image with
`@pytest.mark.skipif`(os.getenv("CI") == "true", reason="No camera available in
CI"), so the test still runs locally when a camera is present; ensure the
decorator references the test function name test_01_take_image and remove the
original pytest.mark.skip import or usage if no longer needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9a02251e-241f-4352-96d9-c5200fb21293
📒 Files selected for processing (1)
PROVESFlightControllerReference/test/int/camera_handler_test.py
| time.sleep(5) # Wait for the camera to power on | ||
|
|
||
|
|
||
| @pytest.mark.skip(reason="Temporary Skip Due to Lack of Camera in CI Environment") |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify current skip patterns and CI-gated skipping conventions in integration tests.
rg -n -C2 'pytest\.mark\.(skip|skipif)\('
rg -n -C2 'os\.getenv\("CI"\)|os\.environ\["CI"\]|CI\s*==' PROVESFlightControllerReference/test/intRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 3062
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="PROVESFlightControllerReference/test/int/camera_handler_test.py"
echo "=== $FILE (first 120 lines) ==="
nl -ba "$FILE" | head -n 120
echo
echo "=== Search for CI env usage across test/int ==="
rg -n --hidden --no-ignore -S '(os\.getenv\(["'\"'"]CI["'\"'"]\)|os\.environ\["'\"'"]CI["'\"'"]|CI\s*==|CI\s*!=|env\.get\(["'\"'"]CI["'\"'"])' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for pytest.mark.skipif with CI in test/int ==="
rg -n -S 'pytest\.mark\.skipif\([^\)]*CI' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for other CI-gating conventions in repository ==="
rg -n -S 'pytest\.mark\.skipif\([^\)]*CI' . || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 245
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="PROVESFlightControllerReference/test/int/camera_handler_test.py"
echo "=== $FILE (first 120 lines) ==="
nl -ba "$FILE" | head -n 120
echo
echo "=== Search for CI env usage across test/int ==="
rg -n --hidden --no-ignore -S '(os\.getenv\(["'\''"]CI["'\''"]\)|os\.environ\["'\''"]CI["'\''"]|CI\s*==|CI\s*!=|env\.get\(["'\''"]CI["'\''"])' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for pytest.mark.skipif with CI in test/int ==="
rg -n -S 'pytest\.mark\.skipif\([^\)]*CI' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for other CI-gating conventions in repository ==="
rg -n -S 'pytest\.mark\.skipif\([^\)]*CI' . || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 245
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="PROVESFlightControllerReference/test/int/camera_handler_test.py"
echo "=== $FILE (lines 1-120 with numbers) ==="
if command -v cat >/dev/null 2>&1; then
cat -n "$FILE" | head -n 120
else
echo "cat not available"
fi
echo
echo "=== Search for CI env usage across test/int ==="
rg -n --hidden --no-ignore -S '(os\.getenv\(["'\''"]CI["'\''"]\)|os\.environ\["'\''"]CI["'\''"]|env\.get\(["'\''"]CI["'\''"]\)|\bCI\s*(==|!=)' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for pytest.mark.skipif that references CI (anywhere) ==="
rg -n -S 'pytest\.mark\.skipif\([^)]*CI' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for any hardware-missing / camera-missing conditionals ==="
rg -n -S '(camera|CAMERA).*(skipif|skip|CI|env|hardware|not set|missing)' PROVESFlightControllerReference/test/int || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 2105
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== camera_handler_test.py (tail) ==="
FILE="PROVESFlightControllerReference/test/int/camera_handler_test.py"
tail -n 60 "$FILE" || true
echo
echo "=== CI env usage in PROVESFlightControllerReference/test/int ==="
rg -n -S 'os\.getenv\(["'\'']CI["'\'']\)|os\.environ\["'\'']CI["'\'']\]|os\.environ\.get\(["'\'']CI["'\'']\)|env\.get\(["'\'']CI["'\'']\)|\bCI\b\s*([!=]=|is\s*|equals)|GITHUB_ACTIONS' "$FILE" PROVESFlightControllerReference/test/int || true
echo
echo "=== CI env usage across repo (limit to python) ==="
rg -n --glob='*.py' -S 'os\.getenv\(["'\'']CI["'\'']\)|os\.environ\["'\'']CI["'\'']\]|os\.environ\.get\(["'\'']CI["'\'']\)|env\.get\(["'\'']CI["'\'']\)|GITHUB_ACTIONS' . || true
echo
echo "=== pytest.mark.skipif patterns containing CI keyword across repo ==="
rg -n --glob='*.py' -S 'pytest\.mark\.skipif\([^\n]*CI|pytest\.mark\.skipif\([^\)]*CI' . || true
echo
echo "=== Any existing helper variable/fixture for CI skipping ==="
rg -n --glob='*.py' -S 'IS_CI|RUNNING_IN_CI|CI_SKIP|skip_if_ci|skipif.*(ci)' . || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 1650
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Search for this test file name in repo ==="
rg -n --hidden --no-ignore --glob='*.yml' --glob='*.yaml' --glob='*.sh' --glob='*.py' 'camera_handler_test\.py' . || true
echo
echo "=== Search for pytest invocation for test/int in workflows/scripts ==="
rg -n --hidden --no-ignore --glob='*.yml' --glob='*.yaml' --glob='*.sh' --glob='*.py' '(pytest.*test/int|pytest.*PROVESFlightControllerReference/test/int|test/int.*pytest)' . || true
echo
echo "=== List any CI/workflow configs ==="
ls -R .github 2>/dev/null || true
echo
echo "=== Search for pytest.mark.skipif usage (any env var) in test/int ==="
rg -n -S 'pytest\.mark\.skipif\(([^)]*)' PROVESFlightControllerReference/test/int || true
echo
echo "=== Search for fixtures/markers that gate hardware/CI in test/int ==="
rg -n -S 'marker|hardware|CI|running in|integration.*skip|skipif' PROVESFlightControllerReference/test/int || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 1817
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== .github/workflows/ci.yaml (first 200 lines) ==="
sed -n '1,200p' .github/workflows/ci.yaml
echo
echo "=== Search ci.yaml for pytest invocation ==="
rg -n --hidden --no-ignore -S 'pytest|test/int|PROVESFlightControllerReference/test/int|integration' .github/workflows/ci.yaml || true
echo
echo "=== Search ci.yaml for CI env var usage/setting ==="
rg -n -S 'CI\s*:|CI=' .github/workflows/ci.yaml || true
echo
echo "=== Search ci.yaml for env blocks ==="
rg -n -S 'env:' .github/workflows/ci.yaml || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 6722
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== .github/workflows/ci.yaml (lines 200-330) ==="
sed -n '200,330p' .github/workflows/ci.yaml
echo
echo "=== Search for make test-integration / pytest flags in Makefile(s) ==="
rg -n --hidden --no-ignore --glob='*Makefile*' 'test-integration|gds-integration|pytest|PYTEST' . || trueRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 6513
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Makefile: lines 200-320 ==="
sed -n '200,320p' Makefile
echo
echo "=== Makefile: lines 320-380 ==="
sed -n '320,380p' MakefileRepository: Open-Source-Space-Foundation/proves-core-reference
Length of output: 8079
Scope the camera test skip to CI only instead of disabling it everywhere.
The test is currently unconditionally skipped via @pytest.mark.skip(...), which prevents test_01_take_image from running in non-CI environments too (where a camera might be present).
`@pytest.mark.skip`(reason="Temporary Skip Due to Lack of Camera in CI Environment")Suggested change
+import os
import pytest
@@
-@pytest.mark.skip(reason="Temporary Skip Due to Lack of Camera in CI Environment")
+@pytest.mark.skipif(
+ os.getenv("CI") == "true",
+ reason="Temporary skip in CI due to lack of camera hardware",
+)
def test_01_take_image(fprime_test_api: IntegrationTestAPI, start_gds):🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@PROVESFlightControllerReference/test/int/camera_handler_test.py` at line 28,
Replace the unconditional skip on test_01_take_image with a CI-only conditional
skip: import os in the test module and replace `@pytest.mark.skip`(...) on
test_01_take_image with `@pytest.mark.skipif`(os.getenv("CI") == "true",
reason="No camera available in CI"), so the test still runs locally when a
camera is present; ensure the decorator references the test function name
test_01_take_image and remove the original pytest.mark.skip import or usage if
no longer needed.
We are temporarily skipping the camera handler test in
maindue to the need to displace the camera from the CI environment.