Container image creation tool.
CEKit helps to build container images from image definition files with strong focus on modularity and code reuse.
- Building container images from YAML image definitions
- Integration/unit testing of images
License: MIT License
Container image creation tool.
CEKit helps to build container images from image definition files with strong focus on modularity and code reuse.
I just realized I probably should have opened an issue for this, since you appear to be using issue :)
PR here:
#7
The default timeout should be used only when a timeout value was not specified in scenario.
Describe the bug
Encoding exception at the end of the test although test succeeds
To reproduce
Use image in https://github.com/jfdenise/wildfly-s2i/tree/wf-17/wildfly-builder-image
Add the feature:
Feature: WildFly basic features
@wildfly/wildfly-centos7
Scenario: Check basic build
Given s2i build https://github.com/jfdenise/wildfly-s2i from test/test-app using wf-17
Expected behavior
No error
Logs
Given s2i build https://github.com/jfdenise/wildfly-s2i from
test/test-app using wf-17 # steps/s2i_steps.py:47 21.106s
2019-05-28 16:42:29,367 - dock.middleware.container - INFO - Removing
container
'0cb1c0586261ab3893df637a65bf9876da6ba6679edb4bc1ccc7f61d5d7dccf3', 1 try...
2019-05-28 16:42:29,382 - dock.middleware.container - INFO - Container
'0cb1c0586261ab3893df637a65bf9876da6ba6679edb4bc1ccc7f61d5d7dccf3' removed
Exception UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in
position 2080: ordinal not in range(128)
2019-05-28 16:42:29,386 cekit ERROR An error occurred while
executing tests
2019-05-28 16:42:29,386 - cekit - ERROR - An error occurred while
executing tests
Environment information:
Instead we should use MAVEN_MIRROR_URL
, if provided.
We use the step "When container is started with args" in quite a few tests, e.g. all of these ones which run a variety of binaries: ls
,rpm
,bash
, but notably not java
.
That step is defined here
https://github.com/cekit/behave-test-steps/blob/v1/steps/container_steps.py#L86
Note that function has a parameter pname
defaulting to java
, but nothing alters that value: it's not parameterized in the @given
or @when
variants that select it.
start_container_with_args
calls wait_for_process(context, pname)
(https://github.com/cekit/behave-test-steps/blob/v1/steps/container_steps.py#L167 , always with pname=java
) which does a busy-loop poll of the process table (via invoking ps
) with a hard-coded 10 second timeout.
Thus, any test using the step "When container is started with args" will have an up-to 10 second delay added to its runtime looking for a java
process before completing.
(I've discovered this while trying to figure out why our GHA tests runs all time out and fail. The last thing they log as running is one of the wait_for_process
polling loops, although that might be a coincidence. The tests stick in that state for 5-6h before GHA kills them.)
The timeout is hardcoded to 10secs and can't be configured.
I am seeing
======================================================== warnings summary =========================================================
tests/test_validate.py::test_simple_image_test
steps/container_steps.py:210: DeprecationWarning: invalid escape sequence \(
tests/test_validate.py::test_image_test_with_override
steps/container_steps.py:210: DeprecationWarning: invalid escape sequence \(
tests/test_validate.py::test_image_test_with_multiple_overrides
steps/container_steps.py:210: DeprecationWarning: invalid escape sequence \(
tests/test_validate.py::test_image_test_with_override_on_cmd
steps/container_steps.py:210: DeprecationWarning: invalid escape sequence \(
This is referring to loader.py
. There are two problems here:
# Fedora / EPEL 8 : python3-requests
# EPEL 7 : python36-requests
deps['requests'] = {
'library': 'requests',
'package': 'python-requests',
'fedora': {
'package': 'python3-requests',
}
}
This could be partially resolved within CEKit if the package determination in tools.py
also allowed <platform><release
as well as <platform>
e.g. centos7
so we could then have:
'package': 'python3-requests',
'centos7': {
'package': 'python36-requests',
}
deps['behave'] = {
'library': 'behave',
'package': 'python2-behave',
'fedora': {
'package': 'python3-behave',
}
}
This is https://bugzilla.redhat.com/show_bug.cgi?id=2106695 and https://bugzilla.redhat.com/show_bug.cgi?id=1885570
cc @jmtd
In the absence of an explicit ref in the step "Given s2i build...", i.e., Given s2i build https://...somerepo.../
with no using branchname
suffix, the S2I steps will default to try to check out a branch named master
, which may not exist in the repository.
Instead I think it should use the repository's default branch name.
We hit this (side issue) by introducing a new repository for cekit/behave tests, https://github.com/jboss-container-images/openjdk-test-applications, which has the default branch name main
. This is the new default, I think, for both Git and Github. (At the time of writing this, I'm about to push a master
branch to that repository as a temporary mitigation).
The culprits are
behave-test-steps/steps/s2i_steps.py
Line 14 in e92a239
behave-test-steps/steps/s2i_steps.py
Line 59 in e92a239
We are in a case where tests scenarii could be shared by multiple images if the s2i build step was configurable (eg: build src repo, tag, context-dir, ...).
A user could write something like:
Given s2i build $BEHAVE_TEST_REPO from $BEHAVE_TEST_APP1 using $BEHAVE_TEST_REPO_TAG
The various env variables would have to be set in the context of the test execution.
We could consider that, if a parameter starts with '$', it is an env variable to be resolved. If no such env variable exists, then the parameter is passed as is to the s2i command.
These seem new! In my terminal output when running a "behave test":
2021-05-24 10:08:25,965 collector.py:41 INFO Fetching common steps from 'https://github.com/cekit/behave-test-steps.git'.
2021-05-24 10:08:26,655 collector.py:73 INFO Collecting finished!
steps/container.py:170: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if retcode is not 0:
steps/container_steps.py:255: SyntaxWarning: "is" with a literal. Did you mean "=="?
if len(output) is 0:
/home/jon/rh/git/images/openjdk/target/test/steps/steps.py:66: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if retcode is not 0:
/home/jon/rh/git/images/openjdk/target/test/steps/container.py:170: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if retcode is not 0:
steps/steps.py:66: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if retcode is not 0:
When killing the container after the test it may happen that it's already not running. In such case we should print some message to suggest to take a look at the container logs because most probably the application did not start correctly, crashed and the container was already removed.
We have testcases that check for a certain number of occurrences of a message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.