facebook / openbmc

OpenBMC is an open software framework to build a complete Linux image for a Board Management Controller (BMC).
631 stars 277 forks source link

circleci: Fix rest-api unit-test #177

Closed peterdelevoryas closed 2 years ago

peterdelevoryas commented 2 years ago

circleci: Fix rest-api unit-test

Summary: rest-api unit tests are failing on the Flake8 step in CircleCI (but not in Sandcastle), this refactors the CircleCI setup to allow Flake8 to pass.

Full context on this fix:

The fix in this diff (#thanks @patrickw3 for suggesting this) is to unpack the qemux86-image rootfs within an existing tmpfs, in this case, /mnt/ramdisk. That way, /dev/shm is automatically a tmpfs.

I've also decoupled the build-qemux86 and unit-test jobs in this diff as well, so that we can run ptest-runner as root, but still build the qemux86-image as a non-root user (which bitbake requires). This is so that we can move the mount command from the rest-api recipe to ptest-runner.

Lastly, to move the /dev/shm mounting step from the rest-api recipe to ptest-runner, I needed to refactor the shell command we use when entering the chroot to run a series of commands everytime we enter the chroot. Everytime we exit the chroot, the mount will disappear.

Test Plan: Making sure CircleCI and Sandcastle unit-tests pass.

facebook-github-bot commented 2 years ago

@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 2 years ago

@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 2 years ago

@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 2 years ago

@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.