-
Notifications
You must be signed in to change notification settings - Fork 0
CI: run fprime-examples integration tests in the examples workflow #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,41 @@ on: | |
| required: false | ||
| type: boolean | ||
| default: true | ||
| run_integration_tests: | ||
| description: "Run an additional job to build the deployment and run integration tests against it." | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| integration_gds_working_directory: | ||
| description: "Directory to start fprime-gds from (relative to repo root). Required when run_integration_tests is true." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| integration_test_working_directory: | ||
| description: "Directory to run pytest from (relative to repo root). Required when run_integration_tests is true." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| integration_binary: | ||
| description: "Path to the FSW binary to run (relative to integration_gds_working_directory). Required when run_integration_tests is true." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| integration_binary_args: | ||
| description: "Arguments passed to the FSW binary." | ||
| required: false | ||
| type: string | ||
| default: "-a 127.0.0.1 -p 50000" | ||
|
Comment on lines
+42
to
+46
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Default binary-args may override the action's own default behavior The Was this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified against |
||
| integration_gds_args: | ||
| description: "Extra arguments passed to fprime-gds (e.g. --dictionary path)." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| integration_pytest_args: | ||
| description: "Extra arguments passed to pytest (e.g. test paths, --dictionary path)." | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| fprime_location: | ||
| description: "Relative path from the external project root to its F´ submodule" | ||
| required: false | ||
|
|
@@ -139,3 +174,71 @@ jobs: | |
| fprime-util check -j8 ${VERBOSE_FLAG} ${TARGET_PLATFORM} --pass-through --output-on-failure | ||
| shell: bash | ||
|
|
||
| runIntegration: | ||
| if: ${{ inputs.run_integration_tests }} | ||
| runs-on: ${{ inputs.runs_on }} | ||
| name: "Integration Tests" | ||
| env: | ||
| FPRIME_LOCATION: ${{ inputs.fprime_location }} | ||
| TARGET_PLATFORM: ${{ inputs.target_platform }} | ||
| steps: | ||
| - name: "Checkout target repository" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| repository: ${{ inputs.target_repository }} | ||
| ref: ${{ inputs.target_ref }} | ||
| - name: "Overlay current F´ revision" | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| path: ${{ inputs.fprime_location }} | ||
| # Install the target project's requirements so its GDS plugins (e.g. custom framing) | ||
| # are available to fprime-gds; fall back to the F´ submodule requirements otherwise. | ||
| - name: "Install requirements.txt" | ||
| run: | | ||
| # Modern build tooling is required so local source packages (e.g. the | ||
| # project's GDS plugins) build with correct metadata; the runner's | ||
| # system pip/setuptools can otherwise produce a broken "UNKNOWN" wheel | ||
| # with no entry points, which silently drops custom framing plugins. | ||
| pip3 install --upgrade pip setuptools wheel | ||
| if [ -f "${{ inputs.build_location }}/requirements.txt" ]; then | ||
| (cd "${{ inputs.build_location }}" && pip3 install -r requirements.txt) | ||
| else | ||
| pip3 install -r ${FPRIME_LOCATION}/requirements.txt | ||
| fi | ||
| shell: bash | ||
|
Comment on lines
+198
to
+210
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 Integration job uses different requirements.txt installation logic than build and UT jobs The integration job ( Was this helpful? React with 👍 or 👎 to provide feedback.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Intentional. The integration job needs the target project's GDS-side dependencies — specifically its custom |
||
| - name: "Generate build cache" | ||
| working-directory: ${{ inputs.build_location }} | ||
| run: | | ||
| if [ "${RUNNER_DEBUG:-0}" = "1" ]; then | ||
| VERBOSE_FLAG=--verbose | ||
| else | ||
| VERBOSE_FLAG= | ||
| fi | ||
| fprime-util generate ${VERBOSE_FLAG} ${TARGET_PLATFORM} | ||
| shell: bash | ||
| - name: "Build" | ||
| working-directory: ${{ inputs.build_location }} | ||
| run: | | ||
| if [ "${RUNNER_DEBUG:-0}" = "1" ]; then | ||
| VERBOSE_FLAG=--verbose | ||
| else | ||
| VERBOSE_FLAG= | ||
| fi | ||
| fprime-util build -j8 ${VERBOSE_FLAG} ${TARGET_PLATFORM} | ||
| shell: bash | ||
| - name: "Make FSW binary executable" | ||
| working-directory: ${{ inputs.integration_gds_working_directory }} | ||
| run: chmod +x ${{ inputs.integration_binary }} | ||
| shell: bash | ||
| - name: "Integration Tests" | ||
| uses: nasa/fprime-actions/run-integration-tests@devel | ||
| with: | ||
| gds-working-directory: ${{ inputs.integration_gds_working_directory }} | ||
| test-working-directory: ${{ inputs.integration_test_working_directory }} | ||
| binary: ${{ inputs.integration_binary }} | ||
| binary-args: ${{ inputs.integration_binary_args }} | ||
| gds-args: ${{ inputs.integration_gds_args }} | ||
| pytest-args: ${{ inputs.integration_pytest_args }} | ||
|
|
||
|
devin-ai-integration[bot] marked this conversation as resolved.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Shell glob patterns in binary and dictionary paths could match multiple entries
The
integration_binarypath (ext-build-examples-repo.yml:44) uses../build-artifacts/*/ExamplesDeployment/bin/ExamplesDeploymentwith a shell glob*. Thechmod +xstep atreusable-project-builder.yml:228runs this unquoted in bash, so the glob will expand. Ifbuild-artifacts/contains exactly one platform directory (e.g.Linux), this works correctly. If multiple platform directories exist (unlikely in CI with a singletarget_platform), thechmodwould apply to all matches (harmless), but thebinaryinput passed to therun-integration-testsaction would be a literal unexpanded string since GitHub Actions inputs are strings, not shell-expanded. The action would need to handle glob expansion internally for this to work.Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The globs are expanded by the shell inside
nasa/fprime-actions/run-integration-tests, which uses$BINARY_PATH/$GDS_ARGSunquoted when launching the FSW binary andfprime-gds. In CI there's exactly one platform directory underbuild-artifacts/(the singletarget_platform), so each glob resolves to a single path. Confirmed against the live run: thechmod +xstep and the FSW launch both resolved the binary correctly. The*is used deliberately so the workflow is platform-agnostic (e.g.LinuxvsDarwin) rather than hard-coding the artifact directory name.