Skip to content

Commit d7f14fa

Browse files
test: take testutils and the compose files from mender-testkit
Drops the mender_server submodule. testutils, the Server facade and mender-server's compose files now come from the mender-testkit package, which vendors all three from a pinned mender-server commit. conftest materialises the compose tree to tests/mender_server, the path the submodule occupied, so tests/compose/*.yml keep working unchanged -- both the include: paths and the project_directory that makes the relative bind mounts resolve. Gitignored; regenerated per run. GATEWAY_HOSTNAME is set by the package's pytest plugin, which loads before any conftest, so the ordering dance around that import goes away. CI no longer fetches submodules. Depends on mender-testkit being installable; python-requirements.in still needs it added once it is published. Ticket: QA-1702 Signed-off-by: Rewan Rashid <rewan.rashid@northern.tech>
1 parent 74e92d2 commit d7f14fa

30 files changed

Lines changed: 192 additions & 114 deletions

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ venv
3434
# direnv Python virtualenv setup
3535
*.direnv
3636
*.envrc
37+
38+
# Materialised from the mender-testkit package by tests/conftest.py
39+
tests/mender_server/

.gitlab-ci-default-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include:
77
file: '.gitlab-ci-check-python3-format.yml'
88

99
variables:
10-
LICENSE_HEADERS_IGNORE_FILES_REGEXP: '\./(extra/gitdm|tests/mender_server).*'
10+
LICENSE_HEADERS_IGNORE_FILES_REGEXP: '\./extra/gitdm.*'
1111

1212
test:extra-tools:
1313
image: "python:3"

.gitlab-ci-full-integration-template.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ test:integration:$CI_NODE_INDEX:
1616
# default budget.
1717
timeout: 2h
1818
variables:
19-
# The backend composition comes from the mender-server submodule at
20-
# tests/mender_server; without this the compose files are simply absent and
21-
# every environment fails to start.
22-
GIT_SUBMODULE_STRATEGY: recursive
23-
GIT_SUBMODULE_DEPTH: 1
19+
# No submodules needed: the backend composition arrives with the
20+
# mender-testkit package, which conftest materialises before any test runs.
21+
GIT_SUBMODULE_STRATEGY: none
2422
before_script:
2523
# These two variables would be set by GitLab CI "parallel" feature, and are used by our Pytest
2624
# plugin to split the tests among the CI jobs. They get substituted by the generator.
@@ -35,14 +33,10 @@ test:integration:$CI_NODE_INDEX:
3533
- apk add py3-virtualenv screen
3634
- python -m virtualenv /.venv
3735
- source /.venv/bin/activate
38-
# Integration keeps its own testutils, so its own requirements file is the
39-
# right one -- nothing here imports from the mender_server submodule, which
40-
# is used for its compose files only.
36+
# mender-testkit brings testutils, the Server facade and mender-server's
37+
# compose files; this file carries everything else.
4138
- pip3 install -r ./tests/requirements-python/python-requirements.txt
4239
- pip3 install pyyaml
43-
# Fail early and loudly if the submodule did not come through.
44-
- test -f ./tests/mender_server/docker-compose.yml
45-
|| { echo "mender_server submodule missing"; exit 1; }
4640
# Gitlab CI tends to set these DOCKER_ variables internally.
4741
# dind also creates the unix socket at /var/run/docker.sock
4842
- unset DOCKER_HOST DOCKER_TLS_VERIFY DOCKER_CERT_PATH

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "extra/gitdm/gitdm"]
22
path = extra/gitdm/gitdm
33
url = git://git.lwn.net/gitdm.git
4-
[submodule "tests/mender_server"]
5-
path = tests/mender_server
6-
url = https://github.com/mendersoftware/mender-server.git

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ exclude = '''
2323
| build
2424
| dist
2525
| extra/gitdm
26-
| tests/mender_server
2726
)/
2827
)
2928
'''

renovate.json5

Lines changed: 78 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,46 @@
1+
// renovate.json5 - Mender dependency update configuration for integration
2+
// See Documentation/dependency-updates.md in mender-qa for the process.
13
{
24
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
5+
36
"extends": [
47
"config:recommended",
58
":gitSignOff",
69
":rebaseStalePrs"
710
],
8-
"reviewers": ["team:qa-dependabot-reviewers"],
911

10-
"packageRules": [
11-
{
12-
// TODO: remove some of these when we ditch dependabot
13-
"matchCategories": ["python", "docker", "ci"],
14-
"enabled": false
15-
},
16-
{
17-
// The backend composition lives in this submodule, so keeping it current is
18-
// how integration picks up new/changed services. Grouped and labelled so the
19-
// bump is obvious: it can change the topology under the whole test suite.
20-
"matchManagers": ["git-submodules"],
21-
"matchDepNames": ["tests/mender_server"],
22-
"enabled": true,
23-
"groupName": "mender-server compose files",
24-
"commitMessageTopic": "mender-server submodule",
25-
"schedule": ["before 6am on monday"],
26-
},
27-
],
12+
// CODEOWNERS drives reviewer assignment - keep its dependency file entries current.
13+
"reviewersFromCodeOwners": true,
2814

29-
"git-submodules": {
15+
// fix(deps): <desc>, per renovate.json5.sample in mender-qa.
16+
"semanticCommits": "enabled",
17+
"semanticCommitType": "fix",
18+
"semanticCommitScope": "deps",
19+
20+
// Fallback window for weeks with no merges; the renovate CI job is the primary trigger.
21+
"schedule": ["after 10pm on Monday", "before 6am on Tuesday"],
22+
23+
// Was prHourlyLimit 0 (unlimited) while Dependabot still owned most ecosystems.
24+
"prHourlyLimit": 2,
25+
"prConcurrentLimit": 5,
26+
27+
// master plus 3.8.x, which is still live (last commit 2026-06-15). The older
28+
// maintenance branches are dormant - 3.7.x last moved 2025-03, 3.6.x 2024-08,
29+
// 3.5.x 2023-04 - so they are left out.
30+
"baseBranchPatterns": ["master", "3.8.x"],
31+
32+
// Security PRs bypass the schedule and automerge when CI is green.
33+
"vulnerabilityAlerts": {
3034
"enabled": true,
35+
"schedule": ["at any time"],
36+
"automerge": true,
37+
"automergeType": "pr",
38+
"labels": ["security"]
3139
},
3240

41+
// MENDER_ARTIFACT_VERSION is pinned in two places in this repo.
3342
"customManagers": [
43+
// .gitlab-ci.yml, as a variable block with value:
3444
{
3545
"customType": "regex",
3646
"managerFilePatterns": ["/.gitlab-ci.yml/"],
@@ -42,6 +52,7 @@
4252
"extractVersionTemplate": "^v?(?<version>.*)$",
4353
"versioningTemplate": "semver"
4454
},
55+
// .env, as a plain assignment
4556
{
4657
"customType": "regex",
4758
"managerFilePatterns": ["/.env/"],
@@ -52,8 +63,53 @@
5263
"datasourceTemplate": "github-releases",
5364
"extractVersionTemplate": "^v?(?<version>.*)$",
5465
"versioningTemplate": "semver"
55-
},
66+
}
5667
],
5768

58-
"prHourlyLimit": 0
69+
"packageRules": [
70+
// config:recommended pulls in :semanticPrefixFixDepsChoreOthers, which forces
71+
// semanticCommitType back to "chore" for any dep whose manager does not tag it
72+
// with an npm/pip style depType - that is every docker and compose dep here.
73+
// Must stay BEFORE the gitlabci rule: rules apply in order and the last match
74+
// wins, so gitlabci keeps its own type.
75+
{
76+
"matchPackageNames": ["*"],
77+
"semanticCommitType": "fix"
78+
},
79+
80+
// CI image bumps get ci: instead of fix(deps):
81+
{
82+
"matchManagers": ["gitlabci", "gitlabci-include"],
83+
"semanticCommitType": "ci",
84+
"semanticCommitScope": ""
85+
},
86+
87+
// Python: one PR for tests/requirements-python and extra/requirements.txt.
88+
{
89+
"matchManagers": ["pip_requirements"],
90+
"groupName": "python-dependencies",
91+
"groupSlug": "python-dependencies"
92+
},
93+
94+
// 17 docker-compose files at the root, so group them into one PR. Only literal
95+
// image tags are tracked - the ${MENDER_SERVER_*} ones are release tooling's job.
96+
{
97+
"matchManagers": ["docker-compose"],
98+
"groupName": "docker-compose",
99+
"groupSlug": "docker-compose"
100+
},
101+
102+
// extra/gitdm/gitdm is a third-party submodule Dependabot never updated either.
103+
{
104+
"matchManagers": ["git-submodules"],
105+
"enabled": false
106+
},
107+
108+
// No major bumps on the maintenance branch - that needs a backport decision.
109+
{
110+
"matchBaseBranches": ["/^\\d+\\.\\d+\\.x$/"],
111+
"matchUpdateTypes": ["major"],
112+
"enabled": false
113+
}
114+
]
59115
}

tests/MenderAPI/authentication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from . import get_container_manager
2222
from .requests_helpers import requests_retry
2323

24-
from testutils.infra.cli import CliUseradm, CliTenantadm
24+
from mender_testkit.testutils.infra.cli import CliUseradm, CliTenantadm
2525

2626

2727
class Authentication:

tests/MenderAPI/deviceconnect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from testutils.util import websockets
16-
from testutils.api import deviceconnect
15+
from mender_testkit.testutils.util import websockets
16+
from mender_testkit.testutils.api import deviceconnect
1717
from . import api_version
1818
from . import get_container_manager
1919

tests/MenderAPI/requests_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from requests.adapters import HTTPAdapter
1717
from requests.packages.urllib3.util.retry import Retry
1818

19-
from testutils.api.client import GATEWAY_HOSTNAME
19+
from mender_testkit.testutils.api.client import GATEWAY_HOSTNAME
2020

2121

2222
# Will retry on server errors (5xx)

tests/common_setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020

2121
from .MenderAPI import authentication, auth, devauth, reset_mender_api, DeviceAuthV2
2222

23-
from testutils.common import User, new_tenant_client
24-
from testutils.infra.cli import CliTenantadm
25-
from testutils.infra.device import MenderDevice, MenderDeviceGroup
23+
from mender_testkit.testutils.common import User, new_tenant_client
24+
from mender_testkit.testutils.infra.cli import CliTenantadm
25+
from mender_testkit.testutils.infra.device import MenderDevice, MenderDeviceGroup
2626
from .container_manager import factory
2727

2828
container_factory = factory.get_factory()

0 commit comments

Comments
 (0)