diff --git a/.github/workflows/container-tests.yml b/.github/workflows/container-tests.yml index c06232b1..23bd73d7 100644 --- a/.github/workflows/container-tests.yml +++ b/.github/workflows/container-tests.yml @@ -19,7 +19,7 @@ jobs: if: | github.event.issue.pull_request - && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-all]')) + && (contains(github.event.comment.body, '[test]') || contains(github.event.comment.body, '[test-upstream]') || contains(github.event.comment.body, '[test-all]')) && contains(fromJson('["OWNER", "MEMBER"]'), github.event.comment.author_association) steps: - uses: sclorg/tfaga-wrapper@main diff --git a/test/run b/test/run index 1104a421..ea10d20e 100755 --- a/test/run +++ b/test/run @@ -29,11 +29,6 @@ test_init_wrapper_true_development test_init_wrapper_false_development " -TEST_LIST_BINARY="\ -test_run_binary_application -test_node_cmd_development_init_wrapper_true -" - TEST_LIST_NODE_ENV="\ test_run_app_application test_connection @@ -164,16 +159,4 @@ evaluate_build_result $? "proxy" TEST_SET=${TESTS:-$TEST_LIST_HW} ct_run_tests_from_testset "hw" -if [[ "$VERSION" != "18" ]]; then - # This test is not available for NodeJS-18 - # There is a traceback in NodeJS. It reached EOL support. - #npm ERR! gyp ERR! System Linux 6.9.12-200.fc40.x86_64 - #npm ERR! gyp ERR! command "/usr/bin/node-18" "/usr/lib/node_modules_18/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" - #npm ERR! gyp ERR! cwd /opt/app-root/src/node_modules/node-rdkafka - #npm ERR! gyp ERR! node -v v18.19.0 - #npm ERR! gyp ERR! node-gyp -v v10.0.1 - #npm ERR! gyp ERR! not ok - TEST_SET=${TESTS:-$TEST_LIST_BINARY} ct_run_tests_from_testset "binary" - - cleanup -fi +cleanup diff --git a/test/run-upstream b/test/run-upstream index 16a779ea..d847549a 100755 --- a/test/run-upstream +++ b/test/run-upstream @@ -29,6 +29,10 @@ test_client_pino test_client_langchainjs " +TEST_LIST_BINARY="\ +test_run_binary_application +" + readonly EXPRESS_REVISION="${EXPRESS_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show express version)}" readonly EXPRESS_REPO="https://github.com/expressjs/express.git" readonly PINO_REVISION=v"${PINO_REVISION:-$(docker run --rm "${IMAGE_NAME}" -- npm show pino version)}" @@ -68,3 +72,16 @@ ct_init cid_file=$CID_FILE_DIR/$(mktemp -u -p . --suffix=.cid) TEST_SET=${TESTS:-$TEST_LIST_CLIENTS} ct_run_tests_from_testset "clients" + +if [[ "$VERSION" != "18" ]]; then + # This test is not available for NodeJS-18 + # There is a traceback in NodeJS. It reached EOL support. + #npm ERR! gyp ERR! System Linux 6.9.12-200.fc40.x86_64 + #npm ERR! gyp ERR! command "/usr/bin/node-18" "/usr/lib/node_modules_18/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" + #npm ERR! gyp ERR! cwd /opt/app-root/src/node_modules/node-rdkafka + #npm ERR! gyp ERR! node -v v18.19.0 + #npm ERR! gyp ERR! node-gyp -v v10.0.1 + #npm ERR! gyp ERR! not ok + TEST_SET=${TESTS:-$TEST_LIST_BINARY} ct_run_tests_from_testset "binary" + +fi \ No newline at end of file diff --git a/test/test-binary/hw.js b/test/test-binary/binary.js similarity index 100% rename from test/test-binary/hw.js rename to test/test-binary/binary.js diff --git a/test/test-binary/package.json b/test/test-binary/package.json index 15998a8d..d04ec1f7 100644 --- a/test/test-binary/package.json +++ b/test/test-binary/package.json @@ -1,7 +1,7 @@ { "name": "hello-world", "version": "0.0.1", - "main": "hw.js", + "main": "binary.js", "engine": { "node": "*", "npm": "*" @@ -10,8 +10,8 @@ "node-rdkafka": "*" }, "scripts": { - "start": "node hw.js", - "dev": "node hw.js" + "start": "node binary.js", + "dev": "node binary.js" }, "license": "" } diff --git a/test/test-lib-nodejs.sh b/test/test-lib-nodejs.sh index 1487f825..3a2b426c 100644 --- a/test/test-lib-nodejs.sh +++ b/test/test-lib-nodejs.sh @@ -26,7 +26,7 @@ check_prep_result() { } image_exists() { - docker inspect $1 &>/dev/null + docker inspect $1 1>/dev/null } container_exists() { @@ -408,9 +408,9 @@ function test_running_client_js { prepare "$1" check_prep_result $? $1 || return run_s2i_build_client "$1" - ct_check_testcase_result $? + ct_check_testcase_result $? || return run_client_test_suite "$1" - ct_check_testcase_result $? + ct_check_testcase_result $? || return } function test_client_express() { @@ -522,45 +522,32 @@ function test_dev_mode_true_development() { } function test_node_cmd_production_init_wrapper_false() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=production INIT_WRAPPER=false NODE_CMD="node server.js" - test_node_cmd app production false "node server.js" - fi + test_node_cmd app production false "node server.js" } function test_node_cmd_development_init_wrapper_true() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=development INIT_WRAPPER=true NODE_CMD="node server.js" - test_node_cmd app development true "node server.js" - fi + # NODE_ENV=development INIT_WRAPPER=true NODE_CMD="node server.js" + test_node_cmd app development true "node server.js" } function test_node_cmd_production_init_wrapper_true() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=production INIT_WRAPPER=true NODE_CMD="node server.js" - test_node_cmd app production true "node server.js" - fi + # NODE_ENV=production INIT_WRAPPER=true NODE_CMD="node server.js" + test_node_cmd app production true "node server.js" } function test_node_cmd_development_init_wrapper_false() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=development INIT_WRAPPER=false NODE_CMD="node server.js" - test_node_cmd app development false "node server.js" - fi + # NODE_ENV=development INIT_WRAPPER=false NODE_CMD="node server.js" + test_node_cmd app development false "node server.js" } function test_init_wrapper_true_development() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=development INIT_WRAPPER=true - test_node_cmd app development true - fi + # NODE_ENV=development INIT_WRAPPER=true + test_node_cmd app development true } function test_init_wrapper_false_development() { - if [ "$OS" != "rhel7" ]; then - # NODE_ENV=development INIT_WRAPPER=true - test_node_cmd app development false - fi + # NODE_ENV=development INIT_WRAPPER=true + test_node_cmd app development false } function test_dev_mode_false_development() { @@ -705,7 +692,10 @@ function test_latest_imagestreams() { function cleanup() { info "Cleaning up the test application image ${IMAGE_NAME}-testapp" if image_exists ${IMAGE_NAME}-testapp; then + info "Image ${IMAGE_NAME}-testapp exist...removing it" docker rmi -f ${IMAGE_NAME}-testapp + echo $? + info "Removed by docker rmi ${IMAGE_NAME}-testapp" fi }