Skip to content

Commit 631cc72

Browse files
committed
Integration test for render directory creation
Test that the renders directory is not created when using fuse. Signed-off-by: J Robert Ray <[email protected]>
1 parent e35a891 commit 631cc72

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) Contributors to the SPK project.
4+
# SPDX-License-Identifier: Apache-2.0
5+
# https://github.com/spkenv/spk
6+
7+
set -o errexit
8+
9+
# when using fuse, the local repo should not get a renders directory created for
10+
# the current user
11+
12+
temp_repo=$(mktemp -d)
13+
14+
cleanup() {
15+
rm -rf "$temp_repo"
16+
}
17+
18+
trap cleanup EXIT
19+
20+
export SPFS_STORAGE_ROOT="$temp_repo"
21+
22+
# create some content that would need to be rendered
23+
SPFS_FILESYSTEM_BACKEND=OverlayFsWithFuse spfs run - -- bash -c "echo hello > /spfs/hello.txt && spfs commit layer -t some-content"
24+
25+
# something that will open the local repo, using fuse
26+
SPFS_FILESYSTEM_BACKEND=OverlayFsWithFuse spfs run some-content -- true
27+
28+
# the renders directory should not have been created
29+
if test -d "$temp_repo/renders"; then
30+
echo "renders directory was not supposed to be created on step 1"
31+
exit 1
32+
fi
33+
34+
# something that will open the local repo, not using fuse
35+
SPFS_FILESYSTEM_BACKEND=OverlayFsWithRenders spfs run some-content -- true
36+
37+
# the renders directory should have been created, to prove the behavior is
38+
# different when not using fuse
39+
if test ! -d "$temp_repo/renders"; then
40+
echo "renders directory was expected to be created on step 2"
41+
exit 1
42+
fi
43+

cspell.json

+1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@
402402
"mkrecipe",
403403
"mksource",
404404
"mksrc",
405+
"mktemp",
405406
"modversions",
406407
"mountpoint",
407408
"mpfr",

0 commit comments

Comments
 (0)