Closed peterdelevoryas closed 2 years ago
@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
@peterdelevoryas has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.
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:
rest-api
unit tests use Flake8 to type check Python 3 type annotations.multiprocessing
.multiprocessing
uses POSIX semaphores./dev/shm
on Linux (man7)/dev/shm
is atmpfs
virtual filesystem./dev/shm
.qemux86-image
rootfs usingchroot
.qemux86-image
rootfs doesn't have/dev/shm
..../qemux86-image-rootfs/dev/shm
and mount a 512MBtmpfs
there.tmpfs
mounts (Forum thread).flake8
fails in CircleCI with "permission denied" while trying to mount/dev/shm
.The fix in this diff (#thanks @patrickw3 for suggesting this) is to unpack the
qemux86-image
rootfs within an existingtmpfs
, in this case,/mnt/ramdisk
. That way,/dev/shm
is automatically atmpfs
.I've also decoupled the
build-qemux86
andunit-test
jobs in this diff as well, so that we can runptest-runner
asroot
, but still build theqemux86-image
as a non-root user (whichbitbake
requires). This is so that we can move themount
command from the rest-api recipe toptest-runner
.Lastly, to move the
/dev/shm
mounting step from the rest-api recipe toptest-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.