Skip to content

e2e: allow quasi-polling from a cron job. - #812

Merged
askervin merged 2 commits into
e2e-live-reportsfrom
e2e-poll-from-cron
Sep 23, 2026
Merged

askervin merged 2 commits into
e2e-live-reportsfrom
e2e-poll-from-cron

Conversation

@klihub

@klihub klihub commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Add a --run-if-changed e2e-runner option to run only if the branch we test has moved since the last run, and do nothing otherwise. This can be used from a frequently enough triggered cron job to effectively poll the remote branch and run a test soon after a new PR has been merged. Add a --force-after e2e-runner option to force a test run after a configurable time even if nothing has changed. Also take a lock in the result root for as long as a run lasts to prevent multiple concurrent test runs.

Add an e2e-cron-job script which is all a crontab line needs. It is configurable with sysconfig-style config file and command line options.


Stack created with GitHub Stacks CLI • Give Feedback 💬

@klihub
klihub added this pull request to stack #814 September 22, 2026 18:47

@askervin askervin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Add --run-if-changed: ask the remote what the branch is at, and do
nothing unless it moved since we last tried. Off unless asked for,
so a run without it tests the branch as it is, as before. With it,
triggering us from cron every few minutes is sane, and a PR gets
tested soon after it lands instead of the following night.
--force-after tests anyway once a configurable time has passed with
nothing new, a day by default.

Also take a lock in the result root for as long as a run lasts. Two
runs there would share a worktree, fight over the test VMs and
publish over each other. Held on a file descriptor, so the kernel
drops it however a run ends.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
Add e2e-cron-job, which is all a crontab line needs: it reads what
a host wants from /etc/sysconfig/nri-plugins-e2e-cron-job and runs
the runner with it. Anything on its own command line is passed
through, for a one-off.

E2E_UPDATE_CLONE fetches and resets the clone to the branch first,
so that the copy of the runner which parses the options is the
branch's too. Off by default: it is a reset --hard of a directory
which may be someone's working tree.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
@askervin
askervin merged commit f4c18f3 into main Sep 23, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants