cekit / behave-test-steps

MIT License
0 stars 21 forks source link

KOGITO-8538 UnboundLocalError: local variable 'exception_cause' referenced before assignment #43

Closed radtriste closed 1 year ago

radtriste commented 1 year ago

When testing Kogito images, we get an issue when checking the output because some variable is not initialized before used.

Also added some logging to be able to debug easily

spolti commented 1 year ago

@rnc can you please take a look?

radtriste commented 1 year ago

@rnc I had to update the Python version as ubuntu-latest seems to be 22.04 now ...

radtriste commented 1 year ago

@rnc logger reverted

radtriste commented 1 year ago

example of usage with defualt logging:

2023-02-01 15:42:14,523 container.py:234        DEBUG Creating container from image 'quay.io/kiegroup/kogito-swf-builder:2.0.0-snapshot'...
2023-02-01 15:42:14,523 - cekit - DEBUG - Creating container from image 'quay.io/kiegroup/kogito-swf-builder:2.0.0-snapshot'...
2023-02-01 15:42:14,523 container.py:250        DEBUG Creating docker container with arguments and image:  quay.io/kiegroup/kogito-swf-builder:2.0.0-snapshot
2023-02-01 15:42:14,523 - cekit - DEBUG - Creating docker container with arguments and image:  quay.io/kiegroup/kogito-swf-builder:2.0.0-snapshot
2023-02-01 15:42:14,586 container.py:145        DEBUG Starting container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791'...
    When container is started with command bash                                                                                         # steps/container_steps.py:107 10.948s
    Then run sh -c 'ls /home/kogito/.m2/repository/io/quarkus/quarkus-bom  | wc -l' in container and immediately check its output for 1 # steps/container_steps.py:277 0.072s
2023-02-01 15:42:25,546 container.py:133        DEBUG Removing container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791'
2023-02-01 15:42:25,546 - cekit - DEBUG - Removing container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791'
2023-02-01 15:42:25,709 container.py:100        INFO  Removing container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791', 1 try...
2023-02-01 15:42:25,709 - cekit - INFO - Removing container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791', 1 try...
2023-02-01 15:42:26,158 container.py:103        INFO  Container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791' removed
2023-02-01 15:42:26,158 - cekit - INFO - Container 'e841725427f6259c613735aeffc1cc552a71819f4bf6dbf98630578fc66db791' removed

I don't see any Output from command %s in container: %s displayed whereas it should

radtriste commented 1 year ago

@rnc logger added to steps

rnc commented 1 year ago

@radtriste Merged! Thanks for the contribution.

spolti commented 1 year ago

Thanks @radtriste and @rnc :)