Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/container-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 1 addition & 18 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
17 changes: 17 additions & 0 deletions test/run-upstream
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
Expand Down Expand Up @@ -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
File renamed without changes.
6 changes: 3 additions & 3 deletions test/test-binary/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hello-world",
"version": "0.0.1",
"main": "hw.js",
"main": "binary.js",
"engine": {
"node": "*",
"npm": "*"
Expand All @@ -10,8 +10,8 @@
"node-rdkafka": "*"
},
"scripts": {
"start": "node hw.js",
"dev": "node hw.js"
"start": "node binary.js",
"dev": "node binary.js"
},
"license": ""
}
44 changes: 17 additions & 27 deletions test/test-lib-nodejs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ check_prep_result() {
}

image_exists() {
docker inspect $1 &>/dev/null
docker inspect $1 1>/dev/null
}

container_exists() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}

Expand Down