Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
tests: restoring the /etc/environment and service units config for each test #3433
Conversation
codecov-io
commented
Jun 5, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #3433 +/- ##
==========================================
+ Coverage 77.24% 77.25% +0.01%
==========================================
Files 371 371
Lines 25519 25519
==========================================
+ Hits 19711 19714 +3
+ Misses 4058 4055 -3
Partials 1750 1750
Continue to review full report at Codecov.
|
mvo5
approved these changes
Jun 6, 2017
Looks good, thanks for this. The restore-each on each suite feels a bit repetitive but I guess there is nothing we can do about it(?) (i.e. there is no global restore-each?).
|
@mvo5 thanks for the review, the change is done. |
|
Reverting the last change due to it is breaking the upgrade tests which don't need the prepare_each_classic |
| + | ||
| +restore_classic() { | ||
| + if [ -f /etc/environment.bak ]; then | ||
| + rm -f /etc/environment.bak |
zyga
Jun 7, 2017
Contributor
Could this file instead be fused into $SPREAD_TEST/snapd-state.tar.gz? I was thinking that we should just capture the environment fully once and then on each test iteration, overwrite the current state with what is in the tarball. There has to be some careful coding to ensure we don't leave garbage around (new files will linger but should be removed) but I'm sure we can overcome that.
sergiocazzolato
Jun 7, 2017
Contributor
Agree with the idea, perhaps we could store initial configurations in $SPREAD_PATH/state/ and then restore from there instead of packing this inside the tar for those things are not exclusive of snapd, what do you think?
sergiocazzolato
added some commits
Jun 5, 2017
| + mkdir -p /etc/systemd/system/snapd.service.d | ||
| + cat <<EOF > /etc/systemd/system/snapd.service.d/local.conf | ||
| +[Unit] | ||
| +StartLimitInterval=0 |
sergiocazzolato commentedJun 5, 2017
To make sure each test leaves the environment as clean as possible, this
branch is adding the restore mechanism to cleanup the snapd service
units config and the /etc/environment to its initial state. Currently
the responsability is on each test.