As we are working on integrating Bluepill into our CI, we realized we need to get more information out of the tests than Bluepill can currently provide. In our case, those are:
screen recordings of failed tests;
system logs for apps under test.
Since such features are heavily use-case dependent, they probably should not be part of the main Bluepill distribution - but they are easily scriptable, given the correct hooks. This PR adds ability to execute arbitrary scripts at the beginning and end of each test case.
Since I'm pretty new to the Bluepill codebase, I am not sure I am hanging the scripts off in the best possible place. (currently the only place "aware" of individual test cases is the SimulatorMonitor) Also, would appreciate a look on whether I'm using the configuration parameters correctly. Any feedback is welcome!
For the sake of completeness, after merging this PR, one could record videos and grab os_logs as follows:
#!/bin/bash
# test_ended.sh
TMP_DIR=/tmp/$BP_SIMULATOR_UDID
PIDFILES=(xcrun.pid log.pid)
for pidfile in "${PIDFILES[@]}"; do
pkill -SIGINT -F $TMP_DIR/$pidfile
rm $TMP_DIR/$pidfile
done
ARTIFACT_PATH=../../artifacts/$BP_TEST_SUITE-$BP_TEST_CASE-$BP_ATTEMPT_NUMBER
if [ "$BP_TEST_STATE" = "PASSED" ]; then
rm $ARTIFACT_PATH.*
fi
Resolves #122 and #385.
As we are working on integrating Bluepill into our CI, we realized we need to get more information out of the tests than Bluepill can currently provide. In our case, those are:
Since such features are heavily use-case dependent, they probably should not be part of the main Bluepill distribution - but they are easily scriptable, given the correct hooks. This PR adds ability to execute arbitrary scripts at the beginning and end of each test case.
Since I'm pretty new to the Bluepill codebase, I am not sure I am hanging the scripts off in the best possible place. (currently the only place "aware" of individual test cases is the
SimulatorMonitor
) Also, would appreciate a look on whether I'm using the configuration parameters correctly. Any feedback is welcome!For the sake of completeness, after merging this PR, one could record videos and grab os_logs as follows: