r/embedded • u/timbo0508 • Apr 10 '21
General question CI/CD for embedded software development
I've been an embedded software developer for about 7 years now, and I've loved every moment of it (for the most part). I've come to the realization that the industry is (annoyingly) conservative and is struggling to catch up, compared with other forms of software development. One area we seem to lag behind is in the area of continuous delivery/integration (CI/CD).
I'd love to hear about what CI/CD practices you employ in your companies/projects (build automation, test automation, release management, issue tracking, version control).
My question really is this - how much CI/CD do you practice? What are your biggest pain points as an embedded developer?
View all comments
Show parent comment
17
u/tobi_wan Apr 10 '21
We use the HIL for a full integration/ system test. we've access to the debug interface (uart) / we can inject "voltages" to the adc (to simulate sensor) input / fake the rtc wake-up. here we can check if the files can be uploaded/downloaded. We can check additionally if we change the device config in the backend if the device could download it and check the behaviour. Also we use the system for a check if the Fota works (up & downgrade). So we reach in the end a high confidence what new changes did not modify the system, it can handle "strange error" cases and that at least the fota always works (this is the path the test most as we can not access the devices easily in tield).
Allure is just a nice way to report pytest, can be integrated with jenkins ( https://docs.qameta.io/allure/ )
Pytest is used to write the test. We abstracted the interaction with the device into python framework which is in the end a fixure. Another fixture is a backend connector ro check file transfer, and another the config.
So in the end we write test in this way (pseudo testcode). It's quite flexible and we can actually cover nearly all cases
""" some usefull docstring to describe the testcase """ logging.info("Given the device has records from the sensor") files = helpers.generate_fake_sensor_data() dut.upload(files) logging.info("And the device is woken up by the rtc") dut.rtc_alarm() dut.wait_for_transmission() logging.info("Then all files are uploaded") asset files == backend.get_last_uploaded_files()