diff --git a/lib/analyze_test_results.py b/lib/analyze_test_results.py index 08609f1..17e2953 100644 --- a/lib/analyze_test_results.py +++ b/lib/analyze_test_results.py @@ -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)) diff --git a/lib/build_base_lxc.sh b/lib/build_base_lxc.sh index 45c0f02..a80a53b 100644 --- a/lib/build_base_lxc.sh +++ b/lib/build_base_lxc.sh @@ -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 diff --git a/lib/common.sh b/lib/common.sh index b80a1c0..6f59133 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -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..." diff --git a/lib/tests_coordination.sh b/lib/tests_coordination.sh index abe3f9c..ed60d7f 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -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