tests: Fix expected history output when system helper is compiled out

Pulls do not go to the temp repo so they are logged when system
helper is compiled out
This commit is contained in:
bbhtt
2026-06-18 21:29:22 +05:30
committed by Sebastian Wick
parent d820c4bc5e
commit ad1ff6da68

View File

@@ -57,7 +57,28 @@ if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_S
exit 1 exit 1
fi fi
diff history-log - >&2 << EOF # Pulls are logged when system helper is compiled out as they do
# not go to the temp child repo anymore
if [ "${HAVE_SYSTEM_HELPER:-1}" = "0" ]; then
cat > expected-log << 'EOF'
add remote system (history-installation) test-repo
pull org.test.Hello.Locale master system (history-installation) test-repo
deploy install org.test.Hello.Locale master system (history-installation) test-repo
pull org.test.Platform master system (history-installation) test-repo
deploy install org.test.Platform master system (history-installation) test-repo
pull org.test.Hello master system (history-installation) test-repo
deploy install org.test.Hello master system (history-installation) test-repo
pull org.test.Hello.Locale master system (history-installation) test-repo
deploy update org.test.Hello.Locale master system (history-installation) test-repo
pull org.test.Hello master system (history-installation) test-repo
deploy update org.test.Hello master system (history-installation) test-repo
uninstall org.test.Hello master system (history-installation)
uninstall org.test.Platform master system (history-installation)
uninstall org.test.Hello.Locale master system (history-installation)
remove remote system (history-installation) test-repo
EOF
else
cat > expected-log << 'EOF'
add remote system (history-installation) test-repo add remote system (history-installation) test-repo
deploy install org.test.Hello.Locale master system (history-installation) test-repo deploy install org.test.Hello.Locale master system (history-installation) test-repo
deploy install org.test.Platform master system (history-installation) test-repo deploy install org.test.Platform master system (history-installation) test-repo
@@ -69,6 +90,9 @@ uninstall org.test.Platform master system (history-installation)
uninstall org.test.Hello.Locale master system (history-installation) uninstall org.test.Hello.Locale master system (history-installation)
remove remote system (history-installation) test-repo remove remote system (history-installation) test-repo
EOF EOF
fi
diff history-log expected-log >&2
if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_START_TIME}" \ if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_START_TIME}" \
--columns=change,application,branch,installation,remote --json > history-log 2>&1; then --columns=change,application,branch,installation,remote --json > history-log 2>&1; then
@@ -77,7 +101,120 @@ if ! ${FLATPAK} --installation=history-installation history --since="${HISTORY_S
exit 1 exit 1
fi fi
diff history-log - >&2 << EOF # Pulls are logged when system helper is compiled out as they do
# not go to the temp child repo anymore
if [ "${HAVE_SYSTEM_HELPER:-1}" = "0" ]; then
cat > expected-log << 'EOF'
[
{
"change" : "add remote",
"application" : "",
"branch" : "",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "pull",
"application" : "org.test.Hello.Locale",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "deploy install",
"application" : "org.test.Hello.Locale",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "pull",
"application" : "org.test.Platform",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "deploy install",
"application" : "org.test.Platform",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "pull",
"application" : "org.test.Hello",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "deploy install",
"application" : "org.test.Hello",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "pull",
"application" : "org.test.Hello.Locale",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "deploy update",
"application" : "org.test.Hello.Locale",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "pull",
"application" : "org.test.Hello",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "deploy update",
"application" : "org.test.Hello",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : "test-repo"
},
{
"change" : "uninstall",
"application" : "org.test.Hello",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : ""
},
{
"change" : "uninstall",
"application" : "org.test.Platform",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : ""
},
{
"change" : "uninstall",
"application" : "org.test.Hello.Locale",
"branch" : "master",
"installation" : "system (history-installation)",
"remote" : ""
},
{
"change" : "remove remote",
"application" : "",
"branch" : "",
"installation" : "system (history-installation)",
"remote" : "test-repo"
}
]
EOF
else
cat > expected-log << 'EOF'
[ [
{ {
"change" : "add remote", "change" : "add remote",
@@ -151,6 +288,9 @@ diff history-log - >&2 << EOF
} }
] ]
EOF EOF
fi
diff history-log expected-log >&2
rm -f ${FLATPAK_CONFIG_DIR}/installations.d/history-inst.conf rm -f ${FLATPAK_CONFIG_DIR}/installations.d/history-inst.conf
rm -rf ${TEST_DATA_DIR}/system-history-installation rm -rf ${TEST_DATA_DIR}/system-history-installation