aboutsummaryrefslogtreecommitdiff
path: root/tests/ci/data.testscript
blob: e269d0d1717f5b3fe776292b4ef7c3ef29e1c256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# file      : tests/ci/data.testscript
# license   : MIT; see accompanying LICENSE file

# Pre-created CI request data directory that will be copied by subsequent
# tests and scope setup commands. The common approach will be that group
# scopes copy and modify the parent scope submission directory as required
# by the nested tests and scopes. Tests will also clone the parent scope
# submission data directory to optionally modify it, use and cleanup at the
# end. Note that configuration can not be shared between multiple submission
# handler processes. Also we need to make sure that submission data
# directories are not cloned while being used by submission handler scripts.
#
data_dir = $regex.replace($path_search('*/request.manifest', $src_base), \
                          '(.*)/.*', \
                          '\1')

request_id = "$data_dir"

# Prepare the repository.
#
rep="file:$~/hello.git#master"
+tar -C $~ -xf $src_base/hello.tar.gz &hello.git/***

# Copy the original CI request data directory to the root scope.
#
+cp -r $src_base/$data_dir ./

# Fix-up the repository value in the request manifest.
#
+sed -i -e "s%^\(repository:\) .+\$%\\1 $rep%" $data_dir/request.manifest

root_data_dir = $~/$data_dir

# The most commonly used submission data directory cloning command that copies
# it from the parent scope working directory.
#
clone_data       = [cmdline] cp --no-cleanup -r ../$data_dir ./
clone_data_clean = [cmdline] cp --no-cleanup -r ../$data_dir ./ &$data_dir/***

# Clones the original submission data directory.
#
clone_root_data       = [cmdline] cp --no-cleanup -r $root_data_dir ./
clone_root_data_clean = [cmdline] cp --no-cleanup -r $root_data_dir ./ &$data_dir/***