aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/py
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-10 16:30:48 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-10 16:30:48 +0200
commit4c93a404f2cc38e3a0b4b0ba8d8bf78afb248df5 (patch)
treeaadeb19ce16c6b48e323f3bcb3ef13bca741c21d /test/py
parenttest: fix Python freezes (diff)
downloadcimple-4c93a404f2cc38e3a0b4b0ba8d8bf78afb248df5.tar.gz
cimple-4c93a404f2cc38e3a0b4b0ba8d8bf78afb248df5.zip
test: more compact CI scripts
Diffstat (limited to 'test/py')
-rw-r--r--test/py/lib/test_repo.py24
1 files changed, 2 insertions, 22 deletions
diff --git a/test/py/lib/test_repo.py b/test/py/lib/test_repo.py
index 8bbb75a..0d722be 100644
--- a/test/py/lib/test_repo.py
+++ b/test/py/lib/test_repo.py
@@ -28,18 +28,10 @@ class Repo:
Process.run(*args, cwd=self.path, **kwargs)
-CI_SCRIPT = r'''#!/usr/bin/env bash
-
-set -o errexit -o nounset -o pipefail
-shopt -s inherit_errexit lastpipe
-
+CI_SCRIPT = r'''#!/bin/sh -e
readonly runs_dir={runs_dir}
-
readonly run_output_template=run_XXXXXX
-
run_output_path="$( mktemp --tmpdir="$runs_dir" "$run_output_template" )"
-readonly run_output_path
-
touch -- "$run_output_path"
'''
@@ -103,14 +95,8 @@ class TestRepoOutput(TestRepo, abc.ABC):
pass
-OUTPUT_SCRIPT_SIMPLE = r'''#!/usr/bin/env bash
-
-set -o errexit -o nounset -o pipefail
-shopt -s inherit_errexit lastpipe
-
+OUTPUT_SCRIPT_SIMPLE = r'''#!/bin/sh -e
timestamp="$( date --iso-8601=ns )"
-readonly timestamp
-
echo "A CI run happened at $timestamp"
'''
@@ -126,8 +112,6 @@ class TestRepoOutputSimple(TestRepoOutput):
OUTPUT_SCRIPT_EMPTY = r'''#!/bin/sh
-
-true
'''
@@ -144,9 +128,7 @@ class TestRepoOutputEmpty(TestRepoOutput):
# Making it a bash script introduces way too much overhead with all the
# argument expansions; it slows things down considerably.
OUTPUT_SCRIPT_LONG = r'''#!/usr/bin/env python3
-
output = {output}
-
import sys
sys.stdout.write(output)
'''
@@ -170,9 +152,7 @@ class TestRepoOutputLong(TestRepoOutput):
OUTPUT_SCRIPT_NULL = r'''#!/usr/bin/env python3
-
output = {output}
-
import sys
sys.stdout.buffer.write(output)
'''