Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run backend unit tests with postgresql #2551

Merged
merged 1 commit into from
Nov 27, 2024

Run backend unit tests with postgresql

5902339
Select commit
Loading
Failed to load commit list.
Merged

Run backend unit tests with postgresql #2551

Run backend unit tests with postgresql
5902339
Select commit
Loading
Failed to load commit list.
Community-TC Integration / Code Review Integration checks: unit tests succeeded Nov 26, 2024 in 3m 14s

Community-TC (pull_request)

Check python code with pytest

Details

View task in Taskcluster | View logs in Taskcluster | View task group in Taskcluster

Task Status

Started: 2024-11-26T15:19:43.547Z
Resolved: 2024-11-26T15:20:45.793Z
Task Execution Time: 1 minute, 2 seconds, 246 milliseconds
Task Status: completed
Reason Resolved: completed
RunId: 0

Artifacts

- public/logs/live_backing.log
- public/logs/live.log


[taskcluster 2024-11-26T15:19:43.581Z] Worker Type (proj-relman/generic-worker-ubuntu-24-04) settings:
[taskcluster 2024-11-26T15:19:43.581Z]   {
[taskcluster 2024-11-26T15:19:43.581Z]     "config": {
[taskcluster 2024-11-26T15:19:43.581Z]       "deploymentId": "844596cdddb1d351"
[taskcluster 2024-11-26T15:19:43.581Z]     },
[taskcluster 2024-11-26T15:19:43.581Z]     "generic-worker": {
[taskcluster 2024-11-26T15:19:43.581Z]       "config": {
[taskcluster 2024-11-26T15:19:43.581Z]         "headlessTasks": false,
[taskcluster 2024-11-26T15:19:43.581Z]         "runTasksAsCurrentUser": false
[taskcluster 2024-11-26T15:19:43.581Z]       },
[taskcluster 2024-11-26T15:19:43.581Z]       "engine": "multiuser",
[taskcluster 2024-11-26T15:19:43.581Z]       "go-arch": "amd64",
[taskcluster 2024-11-26T15:19:43.581Z]       "go-os": "linux",
[taskcluster 2024-11-26T15:19:43.581Z]       "go-version": "go1.23.3",
[taskcluster 2024-11-26T15:19:43.581Z]       "release": "https://github.com/taskcluster/taskcluster/releases/tag/v75.0.0",
[taskcluster 2024-11-26T15:19:43.581Z]       "revision": "1f02e08d3ac9520fd636409dd44f97b9945bf882",
[taskcluster 2024-11-26T15:19:43.581Z]       "source": "https://github.com/taskcluster/taskcluster/commits/1f02e08d3ac9520fd636409dd44f97b9945bf882",
[taskcluster 2024-11-26T15:19:43.581Z]       "version": "75.0.0"
[taskcluster 2024-11-26T15:19:43.581Z]     },
[taskcluster 2024-11-26T15:19:43.581Z]     "image": "projects/community-tc-workers/global/images/generic-worker-ubuntu-24-04-3h7p1s34a3ita9ol73mw",
[taskcluster 2024-11-26T15:19:43.581Z]     "instance-id": "2721733813819955299",
[taskcluster 2024-11-26T15:19:43.581Z]     "instance-type": "projects/757942385826/machineTypes/n2-standard-4",
[taskcluster 2024-11-26T15:19:43.581Z]     "local-ipv4": "10.128.0.19",
[taskcluster 2024-11-26T15:19:43.581Z]     "machine-setup": {
[taskcluster 2024-11-26T15:19:43.581Z]       "maintainer": "[email protected]",
[taskcluster 2024-11-26T15:19:43.581Z]       "script": "https://raw.githubusercontent.com/taskcluster/community-tc-config/4c6600ec749918b8d0ef677d7cec2ef65209074e/imagesets/generic-worker-ubuntu-24-04/bootstrap.sh"
[taskcluster 2024-11-26T15:19:43.581Z]     },
[taskcluster 2024-11-26T15:19:43.581Z]     "project-id": "community-tc-workers",
[taskcluster 2024-11-26T15:19:43.581Z]     "public-hostname": "proj-relman-generic-worker-ubuntu-24-0-aew6pkotrb6bhdql9jpkzg.c.community-tc-workers.internal",
[taskcluster 2024-11-26T15:19:43.581Z]     "public-ipv4": "35.223.73.221",
[taskcluster 2024-11-26T15:19:43.581Z]     "region": "us-central1",
[taskcluster 2024-11-26T15:19:43.581Z]     "zone": "us-central1-f"
[taskcluster 2024-11-26T15:19:43.581Z]   }
[taskcluster 2024-11-26T15:19:43.581Z] Task ID: G3nkZpCPS4KvK_xatEO-zw
[taskcluster 2024-11-26T15:19:43.581Z] === Task Starting ===
[taskcluster:warn 2024-11-26T15:19:43.584Z] This task was designed to run under Docker Worker. Docker Worker is no longer maintained.
[taskcluster:warn 2024-11-26T15:19:43.584Z] In order to execute this task, it is being converted to a Generic Worker task, using the D2G
[taskcluster:warn 2024-11-26T15:19:43.584Z] utility (Docker Worker 2 Generic Worker):
[taskcluster:warn 2024-11-26T15:19:43.584Z]     https://github.com/taskcluster/taskcluster/tree/main/clients/client-shell#translating-docker-worker-task-definitionpayload-to-generic-worker-task-definitionpayload
[taskcluster:warn 2024-11-26T15:19:43.584Z] 
[taskcluster:warn 2024-11-26T15:19:43.584Z] We recommend that you convert all your Docker Worker tasks to Generic Worker tasks, to ensure
[taskcluster:warn 2024-11-26T15:19:43.584Z] continued support. For this task, see the converted payload below. If you have many tasks that
[taskcluster:warn 2024-11-26T15:19:43.584Z] require conversion, consider using the d2g tool (above) directly. It simply takes a Docker
[taskcluster:warn 2024-11-26T15:19:43.584Z] Worker task payload as input, and outputs a Generic Worker task payload. It can also convert
[taskcluster:warn 2024-11-26T15:19:43.584Z] Docker Worker scopes to equivalent Generic Worker scopes.
[taskcluster:warn 2024-11-26T15:19:43.584Z] 
[taskcluster:warn 2024-11-26T15:19:43.584Z] Converted task definition (conversion performed by d2g):
[taskcluster:warn 2024-11-26T15:19:43.584Z] ---
[taskcluster:warn 2024-11-26T15:19:43.584Z]   created: "2024-11-26T15:17:30.396Z"
[taskcluster:warn 2024-11-26T15:19:43.584Z]   deadline: "2024-11-26T16:17:30.396Z"
[taskcluster:warn 2024-11-26T15:19:43.584Z]   dependencies: []
[taskcluster:warn 2024-11-26T15:19:43.584Z]   expires: "2025-11-26T16:17:30.396Z"
[taskcluster:warn 2024-11-26T15:19:43.584Z]   extra: {}
[taskcluster:warn 2024-11-26T15:19:43.584Z]   metadata:
[taskcluster:warn 2024-11-26T15:19:43.584Z]     description: Check python code with pytest
[taskcluster:warn 2024-11-26T15:19:43.584Z]     name: 'Code Review Integration checks: unit tests'
[taskcluster:warn 2024-11-26T15:19:43.584Z]     owner: [email protected]
[taskcluster:warn 2024-11-26T15:19:43.584Z]     source: https://github.com/mozilla/code-review
[taskcluster:warn 2024-11-26T15:19:43.584Z]   payload:
[taskcluster:warn 2024-11-26T15:19:43.584Z]     command:
[taskcluster:warn 2024-11-26T15:19:43.584Z]     - - bash
[taskcluster:warn 2024-11-26T15:19:43.584Z]       - -cx
[taskcluster:warn 2024-11-26T15:19:43.584Z]       - docker run -t --rm --memory-swap -1 --pids-limit -1 -e RUN_ID -e TASKCLUSTER_INSTANCE_TYPE
[taskcluster:warn 2024-11-26T15:19:43.584Z]         -e TASKCLUSTER_ROOT_URL -e TASKCLUSTER_WORKER_LOCATION -e TASK_GROUP_ID -e TASK_ID
[taskcluster:warn 2024-11-26T15:19:43.584Z]         'python:3.12' sh -lxce 'git clone --quiet https://github.com/La0/code-review
[taskcluster:warn 2024-11-26T15:19:43.584Z]         /src && cd /src && git checkout 59023393da811094c53e96160730cffb80e755fb -b
[taskcluster:warn 2024-11-26T15:19:43.584Z]         checks && cd /src/tools && pip install --disable-pip-version-check --no-cache-dir
[taskcluster:warn 2024-11-26T15:19:43.584Z]         --quiet . && cd /src/integration && pip install --disable-pip-version-check
[taskcluster:warn 2024-11-26T15:19:43.584Z]         --no-cache-dir --quiet -r requirements.txt -r requirements-dev.txt && pytest
[taskcluster:warn 2024-11-26T15:19:43.584Z]         -v'
[taskcluster:warn 2024-11-26T15:19:43.584Z]     features:
[taskcluster:warn 2024-11-26T15:19:43.584Z]       backingLog: true
[taskcluster:warn 2024-11-26T15:19:43.584Z]       liveLog: true
[taskcluster:warn 2024-11-26T15:19:43.584Z]     logs:
[taskcluster:warn 2024-11-26T15:19:43.584Z]       backing: public/logs/live_backing.log
[taskcluster:warn 2024-11-26T15:19:43.584Z]       live: public/logs/live.log
[taskcluster:warn 2024-11-26T15:19:43.584Z]     maxRunTime: 3600
[taskcluster:warn 2024-11-26T15:19:43.584Z]     onExitStatus:
[taskcluster:warn 2024-11-26T15:19:43.584Z]       retry:
[taskcluster:warn 2024-11-26T15:19:43.584Z]       - 125
[taskcluster:warn 2024-11-26T15:19:43.584Z]       - 128
[taskcluster:warn 2024-11-26T15:19:43.584Z]     osGroups:
[taskcluster:warn 2024-11-26T15:19:43.584Z]     - docker
[taskcluster:warn 2024-11-26T15:19:43.584Z]   priority: lowest
[taskcluster:warn 2024-11-26T15:19:43.584Z]   projectId: none
[taskcluster:warn 2024-11-26T15:19:43.584Z]   provisionerId: proj-relman
[taskcluster:warn 2024-11-26T15:19:43.584Z]   requires: all-completed
[taskcluster:warn 2024-11-26T15:19:43.584Z]   retries: 5
[taskcluster:warn 2024-11-26T15:19:43.584Z]   routes:
[taskcluster:warn 2024-11-26T15:19:43.584Z]   - checks
[taskcluster:warn 2024-11-26T15:19:43.584Z]   schedulerId: taskcluster-github
[taskcluster:warn 2024-11-26T15:19:43.584Z]   scopes:
[taskcluster:warn 2024-11-26T15:19:43.584Z]   - generic-worker:os-group:proj-relman/generic-worker-ubuntu-24-04/docker
[taskcluster:warn 2024-11-26T15:19:43.584Z]   tags: {}
[taskcluster:warn 2024-11-26T15:19:43.584Z]   taskGroupId: IHyfHVQZQPKOr5UgMv2-jw
[taskcluster:warn 2024-11-26T15:19:43.584Z]   taskQueueId: proj-relman/generic-worker-ubuntu-24-04
[taskcluster:warn 2024-11-26T15:19:43.584Z]   workerType: generic-worker-ubuntu-24-04
[taskcluster:warn 2024-11-26T15:19:43.584Z] 
[taskcluster 2024-11-26T15:19:44.515Z] Uploading redirect artifact public/logs/live.log to URL https://community-websocktunnel.services.mozilla.com/us-central1-f.2721733813819955299.60099/log/YW61JiCQTAKus8_ueV4ctg with mime type "text/plain; charset=utf-8" and expiry 2024-11-26T16:34:44.464Z
[taskcluster 2024-11-26T15:19:44.813Z] Executing command 0: bash -cx 'docker run -t --rm --memory-swap -1 --pids-limit -1 -e RUN_ID -e TASKCLUSTER_INSTANCE_TYPE -e TASKCLUSTER_ROOT_URL -e TASKCLUSTER_WORKER_LOCATION -e TASK_GROUP_ID -e TASK_ID '\''python:3.12'\'' sh -lxce '\''git clone --quiet https://github.com/La0/code-review /src && cd /src && git checkout 59023393da811094c53e96160730cffb80e755fb -b checks && cd /src/tools && pip install --disable-pip-version-check --no-cache-dir --quiet . && cd /src/integration && pip install --disable-pip-version-check --no-cache-dir --quiet -r requirements.txt -r requirements-dev.txt && pytest -v'\'
+ docker run -t --rm --memory-swap -1 --pids-limit -1 -e RUN_ID -e TASKCLUSTER_INSTANCE_TYPE -e TASKCLUSTER_ROOT_URL -e TASKCLUSTER_WORKER_LOCATION -e TASK_GROUP_ID -e TASK_ID python:3.12 sh -lxce 'git clone --quiet https://github.com/La0/code-review /src && cd /src && git checkout 59023393da811094c53e96160730cffb80e755fb -b checks && cd /src/tools && pip install --disable-pip-version-check --no-cache-dir --quiet . && cd /src/integration && pip install --disable-pip-version-check --no-cache-dir --quiet -r requirements.txt -r requirements-dev.txt && pytest -v'
Unable to find image 'python:3.12' locally
3.12: Pulling from library/python
b2b31b28ee3c: Pulling fs layer
c3cc7b6f0473: Pulling fs layer
2112e5e7c3ff: Pulling fs layer
af247aac0764: Pulling fs layer
c7e62dc73b01: Pulling fs layer
35c3ce70330a: Pulling fs layer
f8af1611cc8d: Pulling fs layer
af247aac0764: Waiting
c7e62dc73b01: Waiting
35c3ce70330a: Waiting
c3cc7b6f0473: Verifying Checksum
c3cc7b6f0473: Download complete
2112e5e7c3ff: Verifying Checksum
2112e5e7c3ff: Download complete
c7e62dc73b01: Verifying Checksum
c7e62dc73b01: Download complete
b2b31b28ee3c: Verifying Checksum
b2b31b28ee3c: Download complete
f8af1611cc8d: Verifying Checksum
f8af1611cc8d: Download complete
35c3ce70330a: Verifying Checksum
35c3ce70330a: Download complete
b2b31b28ee3c: Pull complete
c3cc7b6f0473: Pull complete
af247aac0764: Verifying Checksum
af247aac0764: Download complete
2112e5e7c3ff: Pull complete
af247aac0764: Pull complete
c7e62dc73b01: Pull complete
35c3ce70330a: Pull complete
f8af1611cc8d: Pull complete
Digest: sha256:f71437b2bad6af0615875c8f7fbeeeae1b73e3c76b82056d283644aca5afe355
Status: Downloaded newer image for python:3.12
+ id -u
+ [ 0 -eq 0 ]
+ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ export PATH
+ [ #  ]
+ [  ]
+ id -u
+ [ 0 -eq 0 ]
+ PS1=# 
+ [ -d /etc/profile.d ]
+ [ -r /etc/profile.d/*.sh ]
+ unset i
+ [  ]
+ mesg n
+ true
+ git clone --quiet https://github.com/La0/code-review /src
+ cd /src
+ git checkout 59023393da811094c53e96160730cffb80e755fb -b checks
Switched to a new branch 'checks'
+ cd /src/tools
+ pip install --disable-pip-version-check --no-cache-dir --quiet .
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
+ cd /src/integration
+ pip install --disable-pip-version-check --no-cache-dir --quiet -r requirements.txt -r requirements-dev.txt
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
+ pytest -v
============================= test session starts ==============================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 -- /usr/local/bin/python3.12
cachedir: .pytest_cache
rootdir: /src
configfile: pyproject.toml
collecting ... 
collected 2 items                                                              

tests/test_hooks.py::test_jsone_validates PASSED                         [ 50%]
tests/test_workflow.py::test_publish PASSED                              [100%]

=============================== warnings summary ===============================
integration/tests/test_hooks.py::test_jsone_validates
  /usr/local/lib/python3.12/site-packages/jsone/shared.py:97: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    reference = datetime.datetime.utcnow()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================= 2 passed, 1 warning in 0.40s =========================
[taskcluster 2024-11-26T15:20:45.379Z]    Exit Code: 0
[taskcluster 2024-11-26T15:20:45.379Z]    User Time: 34.126ms
[taskcluster 2024-11-26T15:20:45.379Z]  Kernel Time: 64.597ms
[taskcluster 2024-11-26T15:20:45.379Z]    Wall Time: 1m0.565122501s
[taskcluster 2024-11-26T15:20:45.379Z]       Result: SUCCEEDED
[taskcluster 2024-11-26T15:20:45.379Z] === Task Finished ===
[taskcluster 2024-11-26T15:20:45.379Z] Task Duration: 1m0.565562214s
[taskcluster 2024-11-26T15:20:45.513Z] Uploading link artifact public/logs/live.log to artifact public/logs/live_backing.log with expiry 2025-11-26T16:17:30.396Z