Skip to content

Commit 438f4a4

Browse files
committed
Release 1.1.0 (2023-01-23)
Added ----- - `--migration-start-ref` option to `odoo-helper test` command, that allows to specify the starting point for migration test. Fixed ----- - Incorrect handling of running lodoo with different user. Now this have to be fixed.
2 parents 63c4f72 + 3e43205 commit 438f4a4

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Release Notes
22

3+
## Release 1.1.0 (2023-01-23)
4+
5+
### Added
6+
7+
- `--migration-start-ref` option to `odoo-helper test` command, that allows
8+
to specify the starting point for migration test.
9+
10+
### Fixed
11+
12+
- Incorrect handling of running lodoo with different user.
13+
Now this have to be fixed.
14+
15+
---
16+
317
## Release 1.0.1 (2023-01-10)
418

519
### Fixed

lib/pylib/jinja-cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python2
1+
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

44
# Based on:
@@ -125,7 +125,7 @@ def cli(opts, args):
125125

126126
output = ustr(output)
127127

128-
sys.stdout.write(output.encode('utf-8'))
128+
sys.stdout.write(output)
129129
return 0
130130

131131
# ------------

lib/test.bash

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ function test_run_tests {
154154
local fail_on_warn=0;
155155
local with_coverage=0;
156156
local test_migration=0;
157+
local test_migration_start_ref;
157158
local test_migration_repo;
158159
local test_migration_branch;
159160
local test_no_drop_db=0;
@@ -181,6 +182,10 @@ function test_run_tests {
181182
--migration)
182183
test_migration=1;
183184
;;
185+
--migration-start-ref)
186+
test_migration_start_ref="$2";
187+
shift;
188+
;;
184189
--migration-repo)
185190
test_migration=1;
186191
test_migration_repo="$2";
@@ -217,11 +222,19 @@ function test_run_tests {
217222
# Same current repo branch before switching to series branch
218223
test_migration_branch=$(git_get_branch_name);
219224

220-
# Switch to serie branch
221-
echoe -e "${BLUEC}Switching to serie branch ${YELLOWC}${ODOO_VERSION}${BLUEC} before running migration tests.${NC}";
222-
(cd "$test_migration_repo" && \
223-
git fetch origin "$ODOO_VERSION" && \
224-
git checkout origin/"$ODOO_VERSION");
225+
if [ -n "$test_migration_start_ref" ]; then
226+
# Switch to start ref
227+
echoe -e "${BLUEC}Switching to ${YELLOWC}${test_migration_start_ref}${BLUEC} before running migration tests.${NC}";
228+
(cd "$test_migration_repo" && \
229+
git fetch origin && \
230+
git checkout "$test_migration_start_ref");
231+
else
232+
# Switch to serie branch
233+
echoe -e "${BLUEC}Switching to serie branch ${YELLOWC}${ODOO_VERSION}${BLUEC} before running migration tests.${NC}";
234+
(cd "$test_migration_repo" && \
235+
git fetch origin "$ODOO_VERSION" && \
236+
git checkout origin/"$ODOO_VERSION");
237+
fi
225238
fi
226239

227240

@@ -370,6 +383,8 @@ function test_module {
370383
--fail-on-warn - if this option passed, then tests will fail even on warnings
371384
--migration - run migration tests
372385
--migration-repo <repo path> - run migration tests for repo specified by path
386+
--migration-start-ref <ref> - git reference (branch/commit/tag) to start migration from
387+
the system will use this ref as starting point to test migration
373388
--coverage - calculate code coverage (use python's *coverage* util)
374389
--coverage-html - automaticaly generate coverage html report
375390
--coverage-html-dir <dir> - Directory to save coverage report to. Default: ./htmlcov
@@ -455,6 +470,10 @@ function test_module {
455470
run_tests_options+=( --migration-repo "$2" );
456471
shift;
457472
;;
473+
--migration-start-ref)
474+
run_tests_options+=( --migration-start-ref "$2" );
475+
shift;
476+
;;
458477
--no-drop-db)
459478
run_tests_options+=( --no-drop-db );
460479
;;

lib/utils.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function exec_lodoo_u {
251251
local current_user;
252252
current_user=$(whoami);
253253
if [ -n "$SERVER_RUN_USER" ] && [ "$SERVER_RUN_USER" != "$current_user" ]; then
254-
execv sudo -u "$SERVER_RUN_USER" -H -E lodoo "$@";
254+
sudo -u "$SERVER_RUN_USER" -H -E odoo-helper exec lodoo "$@";
255255
else
256256
execv lodoo "$@";
257257
fi

lib/version.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
# Odoo Helper Scripts: Version
1010

1111
# Define version number
12-
ODOO_HELPER_VERSION="1.0.1";
12+
ODOO_HELPER_VERSION="1.1.0";
1313
ODOO_HELPER_CONFIG_VERSION="1";

0 commit comments

Comments
 (0)