Skip to content

Commit

Permalink
Issue71 parallel tests (#72)
Browse files Browse the repository at this point in the history
* Fixes #71: Parallel Tests Fixed

* Removed unwanted comment

* Reverted -x

* Reverted test.sh

* Update test.sh

* Update test.sh

---------

Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com>
  • Loading branch information
HeeManSu and viferga authored Jan 16, 2025
1 parent 6e8a219 commit 3612117
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,14 @@ done

echo "FaaS ready, starting tests."

# Declare arrays to store apps and prefixes globally
declare -a DEPLOYED_APPS
declare -a DEPLOYED_PREFIXES

# Function to run tests
function run_tests() {
local app=$1
local test_func=$2
local delete="${3:-}"

pushd data/$app
deploy
Expand All @@ -73,6 +76,11 @@ function run_tests() {
$test_func $url
popd

if [[ "${TEST_FAAS_STARTUP_DEPLOY}" == "true" ]]; then
DEPLOYED_APPS+=("$app")
DEPLOYED_PREFIXES+=("$prefix")
fi

# Test inspect
echo "Testing inspect functionality."

Expand All @@ -92,11 +100,6 @@ function run_tests() {
fi

echo "Inspection test passed."

# Call delete functionality
if [[ "${TEST_FAAS_STARTUP_DEPLOY}" == "true" ]] || [[ "$delete" == "true" ]]; then
delete_functionality $app $prefix
fi
}

# Function to test delete functionality
Expand Down Expand Up @@ -189,11 +192,10 @@ function test_nodejs_app() {
# Run package tests
echo "Running integration tests for package deployment."

# TODO: Parallel tests (uncomment true for deletion)
run_tests "nodejs-base-app" test_nodejs_app # "true"
run_tests "python-base-app" test_python_base_app # "true"
run_tests "python-dependency-app" test_python_dependency_app # "true"
run_tests "nodejs-dependency-app" test_nodejs_dependency_app # "true"
run_tests "nodejs-base-app" test_nodejs_app
run_tests "python-base-app" test_python_base_app
run_tests "python-dependency-app" test_python_dependency_app
run_tests "nodejs-dependency-app" test_nodejs_dependency_app

echo "Integration tests for package deployment passed without errors."

Expand Down Expand Up @@ -314,11 +316,16 @@ function test_simultaneous_deploy() {
done
}

# TODO: Parallel tests

# Run concurrent tests
# echo "Running simultaneous deployments test."
if [[ "${TEST_FAAS_STARTUP_DEPLOY}" == "true" ]]; then
echo "Running simultaneous deployments test."

# test_simultaneous_deploy
test_simultaneous_deploy

# echo "Simultaneous deployments test tests completed."
echo "Simultaneous deployments test tests completed."

# Delete all deployed apps after tests complete
for i in "${!DEPLOYED_APPS[@]}"; do
delete_functionality "${DEPLOYED_APPS[$i]}" "${DEPLOYED_PREFIXES[$i]}"
done
fi

0 comments on commit 3612117

Please sign in to comment.