git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 3/5] maintenance: use packaged systemd units

From
Max Gautier <mg@max.gautier.name>
Date
Mar 19, 2024, 12:09 UTC
Message-ID
<ZfmAfIErHRZVbd49@framework>
In-Reply-To
<20240318153257.27451-4-mg@max.gautier.name>

I'm working on updating the test in t7900-maintenance.sh, but I might be missing something here:

Show 9 quoted lines
>test_expect_success 'start and stop Linux/systemd maintenance' '
>   write_script print-args <<-\EOF &&
>   printf "%s\n" "$*" >>args
>   EOF
>   
>   XDG_CONFIG_HOME="$PWD" &&
>   export XDG_CONFIG_HOME &&
>   rm -f args &&
>   GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args" git maintenance start --scheduler=systemd-timer &&

Do I understand correctly that this means we're not actually running systemctl here, just printing the arguments to our file ?

Show 30 quoted lines
>	# start registers the repo
>	git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
>
>	for schedule in hourly daily weekly
>	do
>		test_path_is_file "systemd/user/git-maintenance@$schedule.timer" || return 1
>	done &&
>	test_path_is_file "systemd/user/git-maintenance@.service" &&
>
>	test_systemd_analyze_verify "systemd/user/git-maintenance@hourly.service" &&
>	test_systemd_analyze_verify "systemd/user/git-maintenance@daily.service" &&
>	test_systemd_analyze_verify "systemd/user/git-maintenance@weekly.service" &&
>
>	printf -- "--user enable --now git-maintenance@%s.timer\n" hourly daily weekly >expect &&
>	test_cmp expect args &&
>
>	rm -f args &&
>	GIT_TEST_MAINT_SCHEDULER="systemctl:./print-args" git maintenance stop &&
>
>	# stop does not unregister the repo
>	git config --get --global --fixed-value maintenance.repo "$(pwd)" &&
>
>	for schedule in hourly daily weekly
>	do
>		test_path_is_missing "systemd/user/git-maintenance@$schedule.timer" || return 1
>	done &&
>	test_path_is_missing "systemd/user/git-maintenance@.service" &&
>
>	printf -- "--user disable --now git-maintenance@%s.timer\n" hourly daily weekly >expect &&
>	test_cmp expect args

The rest of the systemd tests only check that the service file are in XDG_CONFIG_HOME, which should not be the case anymore.

However, the test does not actually check we have enabled and started the timers as it is , right ?

Should I add that ? I'm not sure how, because it does not seem like the tests run in a isolated env, so it would mess with the systemd user manager of the developper running the tests...

Regarding systemd-analyze verify, do the tests have access to the source directory in a special way, or is using '../..' enough ?

Thanks
-- 
Max Gautier
Previous: Max GautierNext: Eric Sunshine
Message 16 of 22 in “maintenance: use packaged systemd units”
  1. 0/5 maintenance: use packaged systemd unitsMax Gautier, Mar 18, 2024
  2. 1/5 maintenance: package systemd unitsMax Gautier, Mar 18, 2024
  3. Patrick SteinhardtMar 21, 2024
  4. Max GautierMar 21, 2024
  5. Patrick SteinhardtMar 21, 2024
  6. Max GautierMar 21, 2024
  7. Patrick SteinhardtMar 21, 2024
  8. Max GautierMar 21, 2024
  9. Max GautierMar 21, 2024
  10. 2/5 maintenance: add fixed random delay to systemd timersMax Gautier, Mar 18, 2024
  11. Patrick SteinhardtMar 21, 2024
  12. Max GautierMar 21, 2024
  13. 4/5 maintenance: update systemd scheduler docsMax Gautier, Mar 18, 2024
  14. Patrick SteinhardtMar 21, 2024
  15. 3/5 maintenance: use packaged systemd unitsMax Gautier, Mar 18, 2024
  16. Max GautierMar 19, 2024
  17. Eric SunshineMar 19, 2024
  18. Junio C HamanoMar 19, 2024
  19. Max GautierMar 19, 2024
  20. Patrick SteinhardtMar 21, 2024
  21. Max GautierMar 21, 2024
  22. 5/5 DON'T APPLY YET: maintenance: remove cleanup codeMax Gautier, Mar 18, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.