mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-27 05:25:14 +00:00
3875db1974
Adds a read-only Actions job queue: running jobs first, then waiting jobs in the order a runner picks them up. It is shown instance-wide in the admin Actions section with owner, repository and status filters, and per repository in the Actions tab. Both lists refresh in place. Pending work is currently only visible per repository and newest-first, so nothing shows what is queued, in which order, or what occupies the runners. Reordering the queue will be proposed separately. A migration adds indexes for the runner pickup query and repository-scoped status lookups. * Fix #34198 <img width="1345" height="451" alt="image" src="https://github.com/user-attachments/assets/7d52ff76-81b4-44e8-b583-d7d89c9dffcd" /> <img width="1809" height="1134" alt="image" src="https://github.com/user-attachments/assets/4d56c0cb-bae7-4ce2-8f3c-75163b2bc7f4" /> --------- Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
30 lines
1.3 KiB
TypeScript
30 lines
1.3 KiB
TypeScript
import {env} from 'node:process';
|
|
import {expect, test} from '@playwright/test';
|
|
import {apiCreateFiles, apiCreateRepo, apiHeaders, randomString} from './utils.ts';
|
|
|
|
test('job queue refreshes with filter open', async ({page, request}) => {
|
|
const owner = env.GITEA_TEST_E2E_USER;
|
|
const repo = `e2e-queue-${randomString(8)}`;
|
|
await apiCreateRepo(request, {name: repo, autoInit: false});
|
|
await apiCreateFiles(request, owner, repo, [{
|
|
path: '.gitea/workflows/queue.yml',
|
|
content: 'on: workflow_dispatch\njobs:\n queued:\n runs-on: no-runner\n steps:\n - run: exit 0\n',
|
|
}]);
|
|
const dispatch = async () => {
|
|
const response = await request.post(`/api/v1/repos/${owner}/${repo}/actions/workflows/queue.yml/dispatches`, {headers: apiHeaders(), data: {ref: 'main'}});
|
|
expect(response.ok()).toBe(true);
|
|
};
|
|
await dispatch();
|
|
|
|
await page.clock.install();
|
|
await page.goto(`/${owner}/${repo}/actions/job_queue`);
|
|
await page.getByRole('menu').getByText('Status', {exact: true}).click();
|
|
const waitingFilter = page.getByRole('menuitem', {name: 'Waiting'});
|
|
await expect(waitingFilter).toBeVisible();
|
|
|
|
await dispatch();
|
|
await page.clock.fastForward(3000);
|
|
await expect(page.getByRole('link', {name: 'queued #2'})).toBeVisible();
|
|
await expect(waitingFilter).toBeVisible();
|
|
});
|