Skip to content

Commit

Permalink
Merge pull request #55 from fprime-community/build-and-run-unit-tests…
Browse files Browse the repository at this point in the history
…-for-math-component

Build and run unit tests for Math Component project as part of FPrime Projects CI
  • Loading branch information
capsulecorplab authored Apr 3, 2024
2 parents ad13027 + 929216c commit 8bf0e76
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@

## Introduction

This repo provides the source code for building an Immutable-Infrastructure-as-Code (IIAC) workspace image, using Kasm, for the [F´(F Prime)](https://github.com/nasa/fprime) flight software and embedded systems framework, based on an Ansible template for [KASM Ubuntu Jammy](https://hub.docker.com/r/kasmweb/core-ubuntu-jammy) images. The workspace is configured with the following software:
This repo provides the source code for building an Immutable-Infrastructure-as-Code (IIAC) workspace image, using Kasm, for the [F´(F Prime)](https://github.com/nasa/fprime) flight software and embedded systems framework, based on an Ansible template for [KASM Ubuntu Jammy](https://hub.docker.com/r/kasmweb/core-ubuntu-jammy) images. The workspace is configured with the following:

- FPrime Community Projects
- [fprime-workshop-led-blinker](https://github.com/fprime-community/fprime-workshop-led-blinker)
- [fprime-tutorial-math-component](https://github.com/fprime-community/fprime-tutorial-math-component)
- [fprime-baremetal-reference](https://github.com/mdrs-community/fprime-baremetal-reference)
- Cross Compile Toolchain for embedded Linux
- gcc-arm-linux-gnueabihf
- g++-arm-linux-gnueabihf
Expand Down
2 changes: 1 addition & 1 deletion fprime-projects.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ RUN apt update && apt -y install software-properties-common && add-apt-repositor

# run Ansible commands
COPY ./requirements.yaml ./playbook.yaml ./
RUN ansible-galaxy install -r requirements.yaml && ansible-playbook -i,localhost playbook.yaml --tags "build_led_blinker, build_baremetal_reference" && rm -f ./*.yaml
RUN ansible-galaxy install -r requirements.yaml && ansible-playbook -i,localhost playbook.yaml --tags "build_led_blinker, build_math_component, build_baremetal_reference" && rm -f ./*.yaml

# Custom Desktop Background - replace ingenuity_helicopter_on_mars.png on disk with your own background image
COPY ./ingenuity_helicopter_on_mars.png /usr/share/extra/backgrounds/bg_default.png
Expand Down
83 changes: 83 additions & 0 deletions playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,14 @@
- install_fprime_tools
- install_arduino_tools
- build_led_blinker
- build_math_component
- build_baremetal_reference

vars:
fprime_version: "v3.4.0"
arduino_cli_cmake_wrapper_version: "94c3145e5ea4a0a48dc3f70560dfb8a"
fprime_led_blinker_version: "{{ fprime_version }}"
fprime_math_component_version: "{{ fprime_version }}"
fprime_arduino_version: "dbef42a1ea5bfab84930538cbb53fed90af77406"
fprime_baremetal_reference_version: "v3.4.0-0.1.1"

Expand Down Expand Up @@ -292,6 +294,33 @@
executable: /bin/bash
become_user: 1000

# Initialize Math Component project
- name: Clone fprime math component repo
shell:
cmd: git clone --recursive https://github.com/fprime-community/fprime-tutorial-math-component.git
chdir: /home/kasm-default-profile/
executable: /bin/bash
become_user: 1000
- name: Checkout {{ fprime_math_component_version }} in fprime math component repo
shell:
cmd: git checkout {{ fprime_math_component_version }}
chdir: /home/kasm-default-profile/fprime-tutorial-math-component
executable: /bin/bash
become_user: 1000
- name: Fetch fprime submodule
shell:
cmd: git fetch
chdir: /home/kasm-default-profile/fprime-tutorial-math-component/fprime
executable: /bin/bash
become_user: 1000
- name: Checkout {{ fprime_version }} in fprime submodule
shell:
cmd: git checkout {{ fprime_version }}
chdir: /home/kasm-default-profile/fprime-tutorial-math-component/fprime
executable: /bin/bash
become_user: 1000


# Initialize baremetal-reference
- name: Clone fprime-baremetal-reference repo
shell:
Expand Down Expand Up @@ -489,6 +518,60 @@
executable: /bin/bash
become_user: 1000

-
# build Math Component project
hosts: localhost
connection: local
gather_facts: yes
tags:
- build_math_component

tasks:
- name: Initialize submodules in fprime-tutorial-math-component/fprime submodule
shell:
cmd: git submodule update --init --recursive
chdir: /home/kasm-default-profile/fprime-tutorial-math-component/fprime
executable: /bin/bash
become_user: 1000
- name: Generate fprime math component unit tests
shell:
cmd: fprime-util generate --ut
chdir: /home/kasm-default-profile/fprime-tutorial-math-component
executable: /bin/bash
become_user: 1000
- name: Build fprime math component unit tests
shell:
cmd: fprime-util build --ut
chdir: /home/kasm-default-profile/fprime-tutorial-math-component
executable: /bin/bash
become_user: 1000
- name: Run fprime math component unit tests
shell:
cmd: fprime-util check
chdir: /home/kasm-default-profile/fprime-tutorial-math-component
executable: /bin/bash
failed_when: false
changed_when: false
register: fprime_math_ut_output
become_user: 1000
- name: Display fprime math component unit tests stdout
debug:
msg: "{{ fprime_math_ut_output.stdout }}"
become_user: 1000
- name: Display fprime math component unit tests stderr
debug:
msg: "{{ fprime_math_ut_output.stderr }}"
become_user: 1000
- name: Display fprime math component unit tests log
shell:
cmd: cat ./build-fprime-automatic-native-ut/Testing/Temporary/LastTest.log
chdir: /home/kasm-default-profile/fprime-tutorial-math-component
executable: /bin/bash
become_user: 1000
- name: Delete fprime math component repo
shell: rm -rf /home/kasm-default-profile/fprime-tutorial-math-component
become_user: 1000

-
# build baremetal-reference
hosts: localhost
Expand Down

0 comments on commit 8bf0e76

Please sign in to comment.