devspace
devspace copied to clipboard
Results of onUpload.exec.command not rendering in the terminal
What happened?
Trying to run pytest
and coverage
, and display the results in terminal using onUpload.exec.command
.
This is probably just user error. I've asked about it on SO.
What did you expect to happen instead?
That it would display the results, but it does not. You see the command being run, but no results displayed in the terminal.
How can we reproduce the bug? (as minimally and precisely as possible)
It isn't a "problem" unique to pytest
or coverage
, but getting most types of feedback from the container in the terminal. The easiest way to reproduce it is any of the following:
dev:
sync:
...
onUpload:
exec:
- command: ls
# or
onUpload:
exec:
- command: bash -c "ls"
# or
onUpload:
exec:
- command: kubectl exec -it pod-0 -- ls
local: true
# or
onUpload:
exec:
- command: kubectl exec -it pod-0 -- bash -c "ls"
local: true
In each case you'll see the command being run, but not the results:
[api-ut] Upstream - Successfully processed 1 change(s)
[api-ut] Upstream - Execute command 'ls'
[api-ut] Upstream - Done executing command
My devspace.yaml:
version: v1beta11
...
images:
api-ut:
image: ${APP_NAME}/${API_DEV}-ut
dockerfile: ${API}/docker/Dockerfile
context: ${API}/
build:
buildKit:
args:
- "--progress=plain"
options:
target: unit-tests
...
deployments:
- name: ${API}-ut
helm:
componentChart: true
values:
containers:
- image: ${APP_NAME}/${API_DEV}-ut
service:
ports:
- port: 5001
...
dev:
sync:
- name: ${API}-ut
imageSelector: ${APP_NAME}/${API_DEV}-ut
localSubPath: ./${API}
excludeFile: .dockerignore
waitInitialSync: true
onUpload:
exec:
- command: coverage run --omit='src/manage.py,src/config/*,*/.venv/*,*/*__init__.py,*/tests.py,*/admin.py,*/migrations/*,*/apps.py' -m pytest -m=ut
Local Environment:
- DevSpace Version: 5.18.5
- Operating System: mac
- ARCH of the OS: ARM64 Kubernetes Cluster:
- Cloud Provider: azure, but this is a local dev issue using
docker-desktop
- Kubernetes Version:
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.1", GitCommit:"3ddd0f45aa91e2f30c70734b175631bec5b5825a", GitTreeState:"clean", BuildDate:"2022-05-24T12:17:11Z", GoVersion:"go1.18.2", Compiler:"gc", Platform:"darwin/arm64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:29:58Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"linux/arm64"}
Anything else we need to know?
That should cover it. More than likely something I'm doing wrong.