Skip to content

Commit

Permalink
Merge pull request #602 from ap-wtioit/master-add_screencast_tests_gi…
Browse files Browse the repository at this point in the history
…thub

[IMP] tests: add test for screencast
  • Loading branch information
pedrobaeza authored Mar 8, 2024
2 parents 332fec2 + 6233a7f commit 83e883d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 0 deletions.
41 changes: 41 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,47 @@ def test_entrypoint_python(self):
),
)

def test_screencasts(self):
test_artifacts_dir = join(SCAFFOLDINGS_DIR, "test_artifacts")
for sub_env in matrix(odoo_skip={"11.0", "12.0", "13.0", "14.0"}):
self.compose_test(
test_artifacts_dir,
dict(sub_env, UID=str(os.getuid()), GID=str(os.getgid())),
# remove artifacts from previous tests
(
"find",
"/opt/odoo/auto/test-artifacts",
"-type",
"f",
"-exec",
"rm",
"-v",
"{}",
";",
),
# install odoo base module
(
"odoo",
"-i",
"base",
"--stop-after-init",
),
# run odoo test for screencast
(
"odoo",
"--test-tags",
".test_screencasts",
"--stop-after-init",
),
# verify screencast is saved in container
(
"grep",
"-Rl",
".",
"/opt/odoo/auto/test-artifacts",
),
)


if __name__ == "__main__":
unittest.main()
2 changes: 2 additions & 0 deletions tests/scaffoldings/test_artifacts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG ODOO_VERSION
FROM tecnativa/doodba:${ODOO_VERSION}-onbuild
Empty file.
33 changes: 33 additions & 0 deletions tests/scaffoldings/test_artifacts/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "2.1"
services:
odoo:
build:
context: ./
args:
COMPILE: "false"
ODOO_VERSION: $ODOO_MINOR
WITHOUT_DEMO: "false"
# enable creating test artifact directories with correct permissions
UID: "${UID:-1000}"
GID: "${GID:-1000}"
tty: true
depends_on:
- db
environment:
PYTHONOPTIMIZE: ""
UNACCENT: "false"
volumes:
- filestore:/var/lib/odoo:z
- ./test-artifacts:/opt/odoo/auto/test-artifacts:z

db:
image: postgres:${DB_VERSION}-alpine
environment:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoopassword
volumes:
- db:/var/lib/postgresql/data:z

volumes:
db:
filestore:
Empty file.

0 comments on commit 83e883d

Please sign in to comment.