Skip to content

Commit 89d441d

Browse files
pre-commit-ci[bot]majamassarini
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 03d6697 commit 89d441d

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

research/testing/openshift-zuul-test-alternatives.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This research is about giving an answer to [this card](https://github.com/orgs/p
77

88
## Openshift tests using podman kube play
99

10-
Following suggestions in [this research](https://packit.dev/research/testing/openshift-to-podman-kube-play) I have done a quick & dirty setup for running *packit-service openshift tests* using pods created with `podman kube play`.
10+
Following suggestions in [this research](https://packit.dev/research/testing/openshift-to-podman-kube-play) I have done a quick & dirty setup for running _packit-service openshift tests_ using pods created with `podman kube play`.
1111

1212
### Quick and dirty steps for make them running
1313

@@ -117,7 +117,7 @@ This is a **dirty** ansible playbook for doing it
117117
file: "{{ path_to_secrets }}/extra-vars.yml"
118118
name: vault
119119
tags:
120-
- always
120+
- always
121121

122122
# to be able to read the github_app_id from the configuration file in tokman
123123
- name: include packit-service configuration
@@ -257,7 +257,7 @@ index 0d555a13..2740aa4b 100644
257257
- name: test-data-pv
258258
mountPath: /tmp/test_data
259259
- command: ["bash", "/src/files/run_tests.sh"]
260-
- backoffLimit: 1
260+
- backoffLimit: 1
261261
+ #privileged: true
262262
+ #securityContext:
263263
+ # runAsUser: 1024
@@ -281,7 +281,7 @@ index 20ec681b..297064a5 100644
281281
command: ["bash", "-c", "sleep 10000"]
282282
```
283283

284-
Now you can run the packit-service openshift tests using podman kube instead of starting the *service* and the *worker*; remember of running a `podman kube play --down /tmp/xxx.yaml` for every line above where you have used `podman kube play /tmp/xxx.yaml`
284+
Now you can run the packit-service openshift tests using podman kube instead of starting the _service_ and the _worker_; remember of running a `podman kube play --down /tmp/xxx.yaml` for every line above where you have used `podman kube play /tmp/xxx.yaml`
285285

286286
```bash
287287
podman kube play /tmp/redis.yaml
@@ -314,13 +314,13 @@ ________________________________________________ test_get_api_client ___________
314314
"""let's make sure we can get k8s API client"""
315315
> assert sandcastle.Sandcastle.get_api_client()
316316

317-
tests_openshift/openshift_integration/test_sandcastle.py:9:
318-
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
317+
tests_openshift/openshift_integration/test_sandcastle.py:9:
318+
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
319319
/usr/local/lib/python3.9/site-packages/sandcastle/api.py:324: in get_api_client
320320
load_kube_config(client_configuration=configuration)
321321
/usr/local/lib/python3.9/site-packages/kubernetes/config/kube_config.py:792: in load_kube_config
322322
loader = _get_kube_config_loader(
323-
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
323+
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
324324

325325
filename = '~/.kube/config', config_dict = None, persist_config = True
326326
kwargs = {'active_context': None, 'config_persister': <bound method KubeConfigMerger.save_changes of <kubernetes.config.kube_config.KubeConfigMerger object at 0x7ff3a1ea7d30>>}
@@ -335,7 +335,7 @@ kcfg = <kubernetes.config.kube_config.KubeConfigMerger object at 0x7ff3a1ea7d30>
335335
kcfg = KubeConfigMerger(filename)
336336
if persist_config and 'config_persister' not in kwargs:
337337
kwargs['config_persister'] = kcfg.save_changes
338-
338+
339339
if kcfg.config is None:
340340
> raise ConfigException(
341341
'Invalid kube-config file. '
@@ -348,12 +348,13 @@ E kubernetes.config.config_exception.ConfigException: Invalid kube
348348
## Summary
349349

350350
[`podman kube play`](https://docs.podman.io/en/v4.4/markdown/podman-kube-play.1.html) can not be used to test:
351-
- *sandcastle*; we need a k8s cluster to be able to use the `kubernates` library. We could deploy pods in the cluster using [`podman kube apply`](https://docs.podman.io/en/v4.4/markdown/podman-kube-apply.1.html) but still we need an up and running cluster.
352-
- *deployment*; the Openshift tests in the *deployment* repo are checking that pods are up and running on an Openshift dev instance; we can not check the same using `podman kube play` or `podman kube apply` (we would test different deployment settings...).
353351

354-
`podman kube play` can be used for openshift tests in *packit-service* project not related with *sandcastle* but `docker-compose` should be enough for these as well; so I don't really see advantages in using `podman kube play`.
352+
- _sandcastle_; we need a k8s cluster to be able to use the `kubernates` library. We could deploy pods in the cluster using [`podman kube apply`](https://docs.podman.io/en/v4.4/markdown/podman-kube-apply.1.html) but still we need an up and running cluster.
353+
- _deployment_; the Openshift tests in the _deployment_ repo are checking that pods are up and running on an Openshift dev instance; we can not check the same using `podman kube play` or `podman kube apply` (we would test different deployment settings...).
354+
355+
`podman kube play` can be used for openshift tests in _packit-service_ project not related with _sandcastle_ but `docker-compose` should be enough for these as well; so I don't really see advantages in using `podman kube play`.
355356

356-
For tests in *deployment*, *sandcastle* and in *packit-service* (which reference *sandcastle*) we still need a running k8s cluster.
357+
For tests in _deployment_, _sandcastle_ and in _packit-service_ (which reference _sandcastle_) we still need a running k8s cluster.
357358

358-
If I get it correctly, the **strimzi** project has tests running on Testing Farm using *minikube*: https://developers.redhat.com/articles/2023/08/17/how-testing-farm-makes-testing-your-upstream-project-easier#
359-
For this reason I think we can probably make something similar using Openshift (maybe using Openshift Local - I think it makes sense to test everything against an Openshift instance).
359+
If I get it correctly, the **strimzi** project has tests running on Testing Farm using _minikube_: https://developers.redhat.com/articles/2023/08/17/how-testing-farm-makes-testing-your-upstream-project-easier#
360+
For this reason I think we can probably make something similar using Openshift (maybe using Openshift Local - I think it makes sense to test everything against an Openshift instance).

0 commit comments

Comments
 (0)