Commit Graph

258 Commits

Author SHA1 Message Date
Rémy Taymans
0dc011684d Use docker-in-docker to run tests
Cortesy @maisim.

This commit allow to use docker-in-docker to run tests.

Also it will run the tests on python version defined in the
PYTHON_VERSION array. The tox.ini file is not needed anymore.
Test locally can be run on the user python version, and check against
several python version will be done by the CI.

Notice the ODOO_RPC_URL environment variable which allow to mock the RPC
request to the right url.

This tests needs to be run on custom privileged runner.
! Using gitlab runner does not work !
2023-11-09 20:50:46 +01:00
Rémy Taymans
6a36c97ee4 Use last python image for linting
The linting check can be done on any docker image with the latest python
version.

This updates de pre-commit checks and fix file linting to conform to new
standards.
2023-11-09 17:02:24 +01:00
Rémy Taymans
690ab60699 Fix Dockerfile when using root on host
root user should not be used to create container and oow should not be
run as root.

But when running oow in a docker, then the default user of this docker
can be root.

This fix allow to link the odoo user in the odoo environment docker to
match a root user of the host docker.
2023-11-09 16:36:53 +01:00
Rémy Taymans
a3a8af9a70 Fix listing containers during removal of containers
Removing a container can take some time to be performed. Listing
containers when a container is currently being removed may cause errors.
Because listing container and filtering them by name requires to fetch
data from the container that is currently being removed.
2023-11-09 16:27:29 +01:00
Rémy Taymans
a0307847b9 Allow mocking the ODOO_RPC_URL for testing
Depending of the test environment, the url of the odoo container may
change.

Using pytest in a local shell, Odoo will be available at 0.0.0.0
address.

Using pytest in a docker-in-docker environment, the url for the Odoo
container will be exposed on a different address depending on the
configuration of the docker-in-docker environment.

The mock check whether the user has configured a différent URL for the
Odoo RPC calls, and set it accordingly using mock feature.

In the gitlab-ci, the ODOO_RPC_URL should be used to set the correct
address for the RPC calls.
2023-11-09 16:21:20 +01:00
Rémy Taymans
8ea0195aaf Add pytest-mock dev dependencies
The lock file is regenerated and some dependencies are updated.

Poetry now uses a system of group for extra dependencies. Dependencies
for testing purposes has been put in the "dev" group in the
pyproject.toml file.
2023-11-09 16:17:04 +01:00
LE GAL SYLVAIN
71ae846462 Merge branch 'test-disable-copy-db' into 'main'
[FIX] fix copydb tests. do no use case sensitive database name

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!50
2023-11-07 09:57:23 +00:00
Sylvain LE GAL
8235481032 [FIX] fix copydb tests. do no use case sensitive database name 2023-11-07 10:25:22 +01:00
LE GAL SYLVAIN
0c6110373a Merge branch 'FIX-copydb-add-copyfilestore' into 'main'
Finish copydb. (add copy of the filestore)

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!39
2023-07-18 08:55:41 +00:00
Sylvain LE GAL
7a31cc666d [FIX] copydb : add the copy of the filestore
[DOC] Add documentation section for the copydb function
2023-07-17 14:12:14 +02:00
Rémy Taymans
114f7bfe32 Bump to version 0.5.0
Main new features:
- oow psql: run any query on a database
- oow dumpdb: dump database and its filestore
- Documentation improvement.

Other small fixes.
2023-07-13 17:57:15 +02:00
Rémy Taymans
f143e218a0 (Also improve CI) 2023-07-13 14:24:20 +00:00
Simon
070143f3fe Wait for the container name to be truly freed before returning 2023-07-13 14:24:20 +00:00
Rémy Taymans
60f7b78413 Merge branch '26-dump-db-command' into 'main'
[ADD] dumpdb command

Closes #26

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!32
2023-07-12 06:52:11 +00:00
Rémy Taymans
757cc19576 [FIX] dumpdb: error when using force 2023-07-12 08:35:20 +02:00
Rémy Taymans
f130ecf078 [ADD] dumpdb: tests 2023-07-12 08:35:20 +02:00
Rémy Taymans
e9e02d450d [ADD] dumpdb: doc 2023-07-12 08:32:57 +02:00
Rémy Taymans
debf57bac3 [ADD] dumpdb command 2023-07-12 08:32:57 +02:00
LE GAL SYLVAIN
0764b811d5 Merge branch 'ci-build-and-release' into 'main'
[ADD] build and release in CI

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!41
2023-07-11 21:11:18 +00:00
Rémy Taymans
59025a14e0 [ADD] build and release in CI
This will produce the following behaviour:

When a commit with a title like "Bump to version x.y.z" is committed to
main branch (either by merging a merge request or by pushing it directly
to the main branch), a build of the project is triggered and the result
is pushed on PyPI.

Also a release on the github project is created with the version of the
program as title and the content of the commit message as description.

This will help deploying release of oow. It will also warn followers
that a new version is released by a notification if they choose to.

PYPI_USER and PYPI_TOKEN are value set on the gitlab settings of the
project and can only be viewed by maintainers.
2023-07-11 17:03:00 +02:00
LE GAL SYLVAIN
badba4bd31 Merge branch '21-psql-command' into 'main'
[ADD] psql command

Closes #21

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!31
2023-07-06 15:23:02 +00:00
Rémy Taymans
a436490a68 Merge branch '21-psql-command-improvement-sylvain' into '21-psql-command'
Improve #31

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!38
2023-07-06 15:14:39 +00:00
Sylvain LE GAL
c813f3ddd4 -[DOC] psl command : add description 2023-07-06 16:37:52 +02:00
Sylvain LE GAL
8a79974232 [REF] Use f-string to make the code lighter
[FIX] execute_psql_command: make optional database argument working correctly
[FIX] execute_psql_command: avoid to have an error
2023-07-06 16:37:52 +02:00
Rémy Taymans
284417bb00 [ADD] psql command 2023-05-09 21:34:17 +02:00
LE GAL SYLVAIN
3b34f52ddd Merge branch 'DOC-legalsylvain-add-extra-badge' into 'main'
[DOC] Add extra badges

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!35
2023-04-26 19:08:56 +00:00
Sylvain LE GAL
9afa13054e [DOC] Add extra badges 2023-04-26 21:04:18 +02:00
LE GAL SYLVAIN
ec537d1abf Merge branch 'legalsylvain-table-of-content' into 'main'
[DOC] Add Table of content in Readme.md file

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!34
2023-04-26 18:13:07 +00:00
Sylvain LE GAL
17ea6aa9c2 [DOC] Add badges 2023-04-26 19:45:58 +02:00
Sylvain LE GAL
ad0f51267c [DOC] Add Table of content in Readme.md file 2023-04-26 14:49:41 +02:00
LE GAL SYLVAIN
3aab973729 Merge branch 'fix-debian-image-archive' into 'main'
[FIX] Image debian changed repo to archive for V11 and V12 dockerfile

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!33
2023-04-26 10:22:34 +00:00
Cyril Jeanneret
c5c4276a82 Fix image debian changed repo to archive 2023-04-26 06:45:19 +00:00
Rémy Taymans
a161e4d02f Bump to version 0.4.0 2023-03-17 12:33:42 +01:00
LE GAL SYLVAIN
6a7ad7ec37 Merge branch '32-ignore-module-list' into 'main'
Resolve "[oow estimate-workload] Add ignore modules list"

Closes #32

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!30
2023-03-17 10:13:58 +00:00
Rémy Taymans
40c54d2260 [FIX] missing newline in generated files
In a proper file each line end with a newline character, even the last
one.

Wrong file:

Using `write()` function does not add a newline character at the end of
the write. So writing a string in a file with `write()` leads to a file
like this:

```
line1\n
line2\n
lastline
```

Good file:

Using the `print()` command automatically ends the string with a newline
character. So that we ends with a proper file:
```
line1\n
line2\n
lastline\n
```

Also the with statement automatically closes the file at the end of the
block.
2023-03-17 08:54:44 +01:00
Rémy Taymans
15088c9d0f [FIX] config: indentation 2023-03-17 00:16:00 +01:00
Rémy Taymans
a04353b683 [ADD] estimate-workload: ignored module list 2023-03-16 23:26:45 +01:00
Rémy Taymans
acf70013cb Bump to version 0.3.0 2023-03-16 21:09:19 +01:00
LE GAL SYLVAIN
a55b921457 Merge branch 'fix-docker_kill_error_not_found' into 'main'
Fix docker kill error not found and pre-migration files (fix #15 #16)

Closes #16 and #15

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!28
2023-02-28 10:54:42 +00:00
Rémy Taymans
9e0489f1f1 [FIX] upgrade: run pre_migration files 2023-02-28 09:43:54 +01:00
Rémy Taymans
7a2b19664d [FIX] error when killing container 2023-02-28 09:21:53 +01:00
LE GAL SYLVAIN
9a212eeeb5 Merge branch 'imp-estimate_workload-report' into 'main'
[IMP] estimate-workload: add total column in report

Closes #29

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!27
2023-02-22 10:47:23 +00:00
Rémy Taymans
312e654e88 [IMP] estimate_workload: add time configuration 2023-01-27 17:30:50 +01:00
Rémy Taymans
a2423ec4f8 [IMP] estimate-workload: add total column in report 2023-01-18 19:50:29 +01:00
Rémy Taymans
e35aa8d804 Merge branch 'fix-repository_name-case-estimate-workload' into 'main'
[FIX] repository_name

Closes #30 and #24

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!26
2023-01-17 09:48:39 +00:00
Rémy Taymans
0b5ff9ede1 Merge branch 'fix-typo-config' into 'main'
[FIX] Typo in config file

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!25
2023-01-11 11:41:34 +00:00
Rémy Taymans
cfb0c8b65e [FIX] Typo in config file 2023-01-11 12:32:40 +01:00
Rémy Taymans
a5dcd8fdcc [IMP] module repository_name detection
Some repository may have multiples remotes. This tries to find the main
remote when possible.
2023-01-10 19:52:51 +01:00
Rémy Taymans
8c55892d53 [FIX] estimate-workload: not_found module not categorized 2023-01-10 19:51:20 +01:00
Rémy Taymans
9281d6b572 [FIX] repository_name case insensitive 2023-01-10 19:50:20 +01:00