Compare commits

..

3 Commits

Author SHA256 Message Date
Andrii Nikitin
cfb1bc2fe9 ci: convert integration test to multi-cycle benchmarking tool
All checks were successful
Integration tests / t (pull_request) Successful in 1h18m31s
Update .gitea/workflows/t.yaml to perform four sequential test cycles:
   1. Baseline (original state)
   2. After cherry-picking 572e3311 (CP1)
   3. After cherry-picking 8fa732e6 (CP1 + CP2)
   4. After discarding previous CPs and cherry-picking 58f410be

   Each cycle runs test_005_any_maintainer_approval_sufficient 30 times
   to gather pass/fail statistics for performance and stability comparison.
2026-03-11 09:32:03 +01:00
b04755c667 Merge branch 'main' into refactoring-make
Some checks failed
Integration tests / t (pull_request) Failing after 11m36s
Integration tests / t (push) Failing after 11m46s
2026-03-10 12:30:20 +01:00
1fc0be5f60 make: refactor build target into per-module dependencies
Some checks failed
Integration tests / t (pull_request) Has been cancelled
- Replace shell loop in build with explicit module targets
- Add .PHONY for build and module targets
- Keep go build -C <module> -buildmode=pie behavior unchanged
- Enable parallel builds via make -jN build
2026-03-06 11:33:32 +01:00
5 changed files with 153 additions and 17 deletions

View File

@@ -30,31 +30,167 @@ jobs:
git fetch origin ${{ gitea.ref }}
git checkout FETCH_HEAD
working-directory: ./autogits
- name: Prepare binaries
- name: Prepare binaries (baseline)
run: make build
working-directory: ./autogits
- name: Prepare images
- name: Prepare images (baseline)
run: |
make build
podman rmi $(podman images -f "dangling=true" -q)
working-directory: ./autogits/integration
- name: Make sure the pod is down
- name: Make sure the pod is down (1)
run: make down
working-directory: ./autogits/integration
- name: Start images
- name: Start images (baseline)
run: |
make up
make wait_healthy
podman ps
sleep 5
working-directory: ./autogits/integration
- name: Run tests
run: make pytest
- name: Run tests 30 times (baseline)
run: |
pass=0
fail=0
for i in $(seq 1 30); do
echo "Iteration $i/30..."
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
pass=$((pass + 1))
else
fail=$((fail + 1))
fi
done
echo "Summary (baseline): $pass passes, $fail failures"
working-directory: ./autogits/integration
- name: Make sure the pod is down
- name: Make sure the pod is down (2)
run: |
podman ps
make down
working-directory: ./autogits/integration
- name: Cherry-pick 1
run: |
git config user.email "bot@example.com"
git config user.name "Bot"
git cherry-pick 572e33111bd72518f33ec4f7c93a7222282f43999afafac948e1e3da5c3453a0
working-directory: ./autogits
- name: Prepare binaries (after CP1)
run: make build
working-directory: ./autogits
- name: Prepare images (after CP1)
run: |
make build
podman rmi $(podman images -f "dangling=true" -q)
working-directory: ./autogits/integration
- name: Make sure the pod is down (3)
run: make down
working-directory: ./autogits/integration
- name: Start images (after CP1)
run: |
make up
make wait_healthy
podman ps
sleep 5
working-directory: ./autogits/integration
- name: Run tests 30 times (after CP1)
run: |
pass=0
fail=0
for i in $(seq 1 30); do
echo "Iteration $i/30..."
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
pass=$((pass + 1))
else
fail=$((fail + 1))
fi
done
echo "Summary (after CP1): $pass passes, $fail failures"
working-directory: ./autogits/integration
- name: Make sure the pod is down (4)
run: |
podman ps
make down
working-directory: ./autogits/integration
- name: Cherry-pick 2
run: |
git cherry-pick 8fa732e67518769c9a962e6d12c2e70b38f7bc06e26332fb007ac666fa5e38c1
working-directory: ./autogits
- name: Prepare binaries (after CP2)
run: make build
working-directory: ./autogits
- name: Prepare images (after CP2)
run: |
make build
podman rmi $(podman images -f "dangling=true" -q)
working-directory: ./autogits/integration
- name: Make sure the pod is down (5)
run: make down
working-directory: ./autogits/integration
- name: Start images (after CP2)
run: |
make up
make wait_healthy
podman ps
sleep 5
working-directory: ./autogits/integration
- name: Run tests 30 times (after CP2)
run: |
pass=0
fail=0
for i in $(seq 1 30); do
echo "Iteration $i/30..."
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
pass=$((pass + 1))
else
fail=$((fail + 1))
fi
done
echo "Summary (after CP2): $pass passes, $fail failures"
working-directory: ./autogits/integration
- name: Make sure the pod is down (6)
run: |
podman ps
make down
working-directory: ./autogits/integration
- name: Discard and Cherry-pick 3
run: |
git reset --hard FETCH_HEAD
git cherry-pick 58f410befce4da40f3ebc27e21ac81a55b6425dd4214e08eb59359d54322a29d
working-directory: ./autogits
- name: Prepare binaries (after CP3)
run: make build
working-directory: ./autogits
- name: Prepare images (after CP3)
run: |
make build
podman rmi $(podman images -f "dangling=true" -q)
working-directory: ./autogits/integration
- name: Make sure the pod is down (7)
run: make down
working-directory: ./autogits/integration
- name: Start images (after CP3)
run: |
make up
make wait_healthy
podman ps
sleep 5
working-directory: ./autogits/integration
- name: Run tests 30 times (after CP3)
run: |
pass=0
fail=0
for i in $(seq 1 30); do
echo "Iteration $i/30..."
if podman exec -t tester pytest -v tests/workflow_pr_review_test.py::test_005_any_maintainer_approval_sufficient; then
pass=$((pass + 1))
else
fail=$((fail + 1))
fi
done
echo "Summary (after CP3): $pass passes, $fail failures"
working-directory: ./autogits/integration
- name: Final cleanup
if: always()
run: |
podman ps
make down
working-directory: ./autogits/integration

View File

@@ -1,4 +1,8 @@
MODULES := devel-importer utils/hujson utils/maintainer-update gitea-events-rabbitmq-publisher gitea_status_proxy group-review obs-forward-bot obs-staging-bot obs-status-service workflow-direct workflow-pr
build:
for m in $(MODULES); do go build -C $$m -buildmode=pie || exit 1 ; done
.PHONY: build $(MODULES)
build: $(MODULES)
$(MODULES):
go build -C $@ -buildmode=pie

View File

@@ -857,13 +857,12 @@ func (gitea *GiteaTransport) ResetTimelineCache(org, repo string, idx int64) {
func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models.TimelineComment, error) {
page := int64(1)
resCount := 1
disableCache := GetEnvOverrideBool(os.Getenv("AUTOGITS_TIMELINE_CACHE_DISABLE"), false)
prID := fmt.Sprintf("%s/%s!%d", org, repo, idx)
giteaTimelineCacheMutex.RLock()
TimelineCache, IsCached := giteaTimelineCache[prID]
var LastCachedTime strfmt.DateTime
if IsCached && !disableCache {
if IsCached {
l := len(TimelineCache.data)
if l > 0 {
LastCachedTime = TimelineCache.data[0].Updated
@@ -880,10 +879,6 @@ func (gitea *GiteaTransport) GetTimeline(org, repo string, idx int64) ([]*models
giteaTimelineCacheMutex.Lock()
defer giteaTimelineCacheMutex.Unlock()
if disableCache {
TimelineCache = TimelineCacheData{}
}
for resCount > 0 {
opts := issue.NewIssueGetCommentsAndTimelineParams().WithOwner(org).WithRepo(repo).WithIndex(idx).WithPage(&page)
if !LastCachedTime.IsZero() {

View File

@@ -95,7 +95,6 @@ services:
- AMQP_USERNAME=gitea
- AMQP_PASSWORD=gitea
- SSL_CERT_FILE=/usr/share/pki/trust/anchors/gitea-rabbitmq-ca.crt
- AUTOGITS_TIMELINE_CACHE_DISABLE=1
volumes:
- ./gitea-data:/var/lib/gitea:ro,z
- ./workflow-pr/workflow-pr.json:/etc/workflow-pr.json:ro,z

View File

@@ -139,6 +139,7 @@ index 00000000..473a0f4c
@pytest.mark.t005
# @pytest.mark.xfail(reason="TBD troubleshoot")
def test_005_any_maintainer_approval_sufficient(maintainer_env, ownerA_client, ownerBB_client):
"""
Test scenario:
@@ -200,6 +201,7 @@ index 00000000..473a0f4c
@pytest.mark.t006
@pytest.mark.xfail(reason="tbd flacky in ci")
def test_006_maintainer_rejection_removes_other_requests(maintainer_env, ownerA_client, ownerBB_client):
"""
Test scenario: