Add more infos in the results.json (and save results.json in the main dir)

This commit is contained in:
Alexandre Aubin 2020-12-25 18:59:28 +01:00
parent 5062ae38fd
commit ee565d20eb
4 changed files with 14 additions and 8 deletions

View file

@ -153,7 +153,8 @@ def level_9(tests):
and "App.qualify_for_level_9" in linter_tests[0]["results"]["success"]
tests = list(load_tests(sys.argv[1]))
text_context = sys.argv[1]
tests = list(load_tests(test_context))
test_types = {
"PACKAGE_LINTER": "Package linter",
@ -211,6 +212,10 @@ print()
summary = {
"commit": open(test_context + "/commit").read().strip(),
"architecture": open(test_context + "/architecture").read().strip(),
"yunohost_version": open(test_context + "/ynh_version").read().strip(),
"yunohost_branch": open(test_context + "/ynh_branch").read().strip(),
"tests": [{
"test_type": t["test_type"],
"test_arg": t["test_arg"],
@ -221,7 +226,4 @@ summary = {
"global_level": global_level.level
}
sys.stderr.write(json.dumps(summary))
sys.stderr.write(json.dumps(summary, indent=4))

View file

@ -39,7 +39,7 @@ function rebuild_base_lxc()
INSTALL_SCRIPT="https://install.yunohost.org/$DIST"
$IN_LXC apt install curl -y
$IN_LXC /bin/bash -c "curl $INSTALL_SCRIPT | bash -s -- -a $YNH_BRANCH"
$IN_LXC /bin/bash -c "curl $INSTALL_SCRIPT | bash -s -- -a -d $YNH_BRANCH"
$IN_LXC systemctl -q stop apt-daily.timer
$IN_LXC systemctl -q stop apt-daily-upgrade.timer

View file

@ -16,7 +16,6 @@ YNH_BRANCH=${YNH_BRANCH:-stable}
LXC_BASE="ynh-appci-$DIST-$ARCH-$YNH_BRANCH-base"
LXC_NAME="ynh-appci-$DIST-$ARCH-$YNH_BRANCH-test"
YNH_BRANCH="-d $YNH_BRANCH"
readonly lock_file="./pcheck.lock"
@ -275,6 +274,8 @@ function fetch_package_to_test() {
cp -a "$path_to_package_to_test" "$package_path"
fi
git -C $package_path rev-parse HEAD > $TEST_CONTEXT/commit
# Check if the package directory is really here.
if [ ! -d "$package_path" ]; then
log_critical "Unable to find the directory $package_path for the package..."

View file

@ -270,6 +270,9 @@ run_all_tests() {
# Print the version of YunoHost from the LXC container
log_small_title "YunoHost versions"
LXC_START "yunohost --version"
LXC_START "yunohost --version --output-as json | jq -r .yunohost.version" >> $TEST_CONTEXT/ynh_version
LXC_START "yunohost --version --output-as json | jq -r .yunohost.repo" >> $TEST_CONTEXT/ynh_branch
echo $ARCH > $TEST_CONTEXT/architecture
# Init the value for the current test
current_test_number=1
@ -283,7 +286,7 @@ run_all_tests() {
# Print the final results of the tests
log_title "Tests summary"
python3 lib/analyze_test_results.py $TEST_CONTEXT 2>$TEST_CONTEXT/summary.json
python3 lib/analyze_test_results.py $TEST_CONTEXT 2>./results.json
# Restore the started time for the timer
starttime=$complete_start_timer