Skip to content

Commit

Permalink
[FIX] Fix tests that rely on repo_merge
Browse files Browse the repository at this point in the history
git-aggregator 4.0 default fast-forward behavior overrides the git
configuration in 099-create-fake-odoo.
Replace it with 099-create-fake-odo to create a fake odoo repo with two
branches.
  • Loading branch information
PabloEForgeFlow committed Nov 27, 2023
1 parent 45df6f6 commit 98c5338
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ def test_repo_merge_aggregate_permissions(self):
UID=str(os.getuid()),
GID=str(os.getgid()),
),
# prepare repos.yaml to be non fast forward
("/opt/odoo/custom/build.d/099-git_merge_no_ff",),
# create a fake odoo git repo to ensure a merge commit is created
("/opt/odoo/custom/build.d/099-create-fake-odoo",),
# autoaggregate as odoo:odoo to check if merges also work
("autoaggregate",),
(
Expand Down
18 changes: 18 additions & 0 deletions tests/scaffoldings/repo_merge/custom/build.d/099-create-fake-odoo
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
mkdir /tmp/fake-odoo
cd /tmp/fake-odoo

git init
touch odoo-bin
git add odoo-bin
git commit -m odoo-bin

git checkout -b branch1
touch 1.txt
git add 1.txt
git commit -m 1.txt

git checkout -b branch2 HEAD~1
touch 2.txt
git add 2.txt
git commit -m 2.txt
10 changes: 0 additions & 10 deletions tests/scaffoldings/repo_merge/custom/build.d/099-git_merge_no_ff

This file was deleted.

9 changes: 3 additions & 6 deletions tests/scaffoldings/repo_merge/custom/src/repos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
defaults:
depth: $DEPTH_MERGE
remotes:
ocb: https://github.com/OCA/OCB.git
target: ocb $ODOO_VERSION
local: /tmp/fake-odoo
merges:
# $ODOO_VERSION^1 gets replaced by commit sha that is one behind $ODOO_VERSION in OCB repo by 099-git_merge_no_ff
# in this test, to force gitaggregate creating a merge request
- ocb $ODOO_VERSION^1
- ocb $ODOO_VERSION
- local branch1
- local branch2
1 change: 1 addition & 0 deletions tests/scaffoldings/repo_merge/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
args:
COMPILE: "false"
ODOO_VERSION: $ODOO_MINOR
PIP_INSTALL_ODOO: "false" # ensure build.d/700-odoo-install does not fail
WITHOUT_DEMO: "false"
environment:
PYTHONOPTIMIZE: ""
Expand Down

0 comments on commit 98c5338

Please sign in to comment.