Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

travis multi-build - V1 (shared files) #22136

Draft
wants to merge 71 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f683317
feat(builds) - separate builds
ttodua Apr 12, 2024
8b8d74b
-
ttodua Apr 12, 2024
ece7969
-
ttodua Apr 12, 2024
85ccff2
-
ttodua Apr 12, 2024
8383df7
futher updates
ttodua Apr 12, 2024
498063c
simpler variable
ttodua Apr 12, 2024
719d7fd
-
ttodua Apr 12, 2024
baa6731
runtest env
ttodua Apr 12, 2024
6895761
retest old
ttodua Apr 12, 2024
9054d93
renew
ttodua Apr 12, 2024
1d48b22
newold
ttodua Apr 12, 2024
a2e39d9
-
ttodua Apr 12, 2024
ac1815f
-
ttodua Apr 12, 2024
0fb7729
move to top
ttodua Apr 12, 2024
f098ee9
test old
ttodua Apr 12, 2024
21f11ac
move to top
ttodua Apr 12, 2024
f7fc8cf
move to top
ttodua Apr 12, 2024
fecec31
jobs matrix
ttodua Apr 12, 2024
1ef8cff
jobs-
ttodua Apr 12, 2024
f95ea35
jobstop
ttodua Apr 12, 2024
1ad4d3d
if
ttodua Apr 12, 2024
39914b8
correct if
ttodua Apr 12, 2024
d59ea79
indents
ttodua Apr 12, 2024
2ed252a
-
ttodua Apr 12, 2024
25e23af
tmp
ttodua Apr 12, 2024
927eebd
-
ttodua Apr 12, 2024
3262d39
major sample
ttodua Apr 12, 2024
8de4794
remvoe comments
ttodua Apr 12, 2024
5c181a8
dummy change
ttodua Apr 12, 2024
29916cf
id-tests
ttodua Apr 12, 2024
4b5b160
build correct
ttodua Apr 12, 2024
0e1984c
fixes
ttodua Apr 12, 2024
c8630cc
dummy change base
ttodua Apr 12, 2024
a5975d8
build
ttodua Apr 12, 2024
9dcbcae
pretranspile
ttodua Apr 12, 2024
d9f97d7
statics rev
ttodua Apr 13, 2024
e2f7de9
fix idtests
ttodua Apr 13, 2024
d00fa91
further updates
ttodua Apr 13, 2024
cd335aa
runtests fixes and update
ttodua Apr 13, 2024
69bdfae
runtests updates
ttodua Apr 13, 2024
803014d
Merge branch 'master' of https://github.com/ccxt/ccxt into two-builds
ttodua Apr 13, 2024
b34fad9
multi stages
ttodua Apr 13, 2024
cd03485
[skip ci]
ttodua Apr 13, 2024
87d645d
Merge branch 'master' of https://github.com/ccxt/ccxt into two-builds
ttodua Apr 14, 2024
06664a0
Merge branch 'master' of https://github.com/ccxt/ccxt into two-builds
ttodua Apr 15, 2024
fc2198b
minor
ttodua Apr 15, 2024
8011307
-
ttodua Apr 15, 2024
b1c0e79
test
ttodua Apr 15, 2024
f3e50dc
-
ttodua Apr 15, 2024
f1f4431
-
ttodua Apr 15, 2024
37e4e22
-
ttodua Apr 15, 2024
80b3071
ttest1
ttodua Apr 15, 2024
6ac53be
-
ttodua Apr 15, 2024
70af219
-
ttodua Apr 15, 2024
9c0b3a5
deploy stages
ttodua Apr 15, 2024
6a5c474
comment
ttodua Apr 15, 2024
f530319
finalstage- move into runstep
ttodua Apr 15, 2024
7023f1e
env run
ttodua Apr 15, 2024
c6fd76d
test1
ttodua Apr 15, 2024
070d310
final version
ttodua Apr 15, 2024
bd855a7
-
ttodua Apr 18, 2024
ae79c70
upd
ttodua Apr 18, 2024
5543d26
Merge branch 'master' of https://github.com/ccxt/ccxt into two-builds
ttodua Apr 19, 2024
9f2fb40
minor
ttodua Apr 19, 2024
f3799e5
further updates
ttodua Apr 19, 2024
a2a1be2
Discard changes to ts/src/gate.ts
ttodua Apr 19, 2024
5e8c4e6
move to deploy.sh
ttodua Apr 26, 2024
cb18f69
rebuild2
ttodua Apr 26, 2024
403fccd
Merge branch 'two-builds' of github.com:ttodua/ccxt into two-builds
ttodua Apr 26, 2024
10f5540
-
ttodua Apr 26, 2024
39bbef2
-
ttodua Apr 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
124 changes: 69 additions & 55 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
jobs:
include:
- stage: first_stage
env: RUNSTEP=PY_JS_PHP

- stage: second_stage
env: RUNSTEP=C_SHARP

- stage: final_stage
if: build.result == 0 # Run only if previous stages succeed
script:
- git checkout master composer.json
- if [ "$RUNSTEP" == "PY_JS_PHP" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
export SHOULD_DEPLOY=false;
DEPLOY_OUTPUT=$(env DEPLOY_CACHE=.cache/deploy SECONDS_BEFORE_NEXT_DEPLOY=43200 TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE}" ./build/deploy.sh) && SHOULD_DEPLOY=true;
echo "----------------";
echo "${DEPLOY_OUTPUT}";
echo "${SHOULD_DEPLOY}";
echo "----------------";
if $SHOULD_DEPLOY; then
echo "Publishing";
npm config set git-tag-version=false && NPM_VERSION=$(npm version patch);
npm run vss && npm run copy-python-files && npm run buildCSRelease;
env COMMIT_MESSAGE=${NPM_VERSION:1} GITHUB_TOKEN=${GITHUB_TOKEN} SHOULD_TAG=${SHOULD_DEPLOY} ./build/push.sh;
./cs/deploy.sh;
cd python && env PYPI_TOKEN=${PYPI_TOKEN} ./deploy.sh && cd ..;
else
echo "Not publishing";
env COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE}" GITHUB_TOKEN=${GITHUB_TOKEN} SHOULD_TAG=${SHOULD_DEPLOY} ./build/push.sh;
fi;
fi
after_failure:
- sleep 10
before_deploy:
- echo $SHOULD_DEPLOY
deploy:
- provider: npm
email: [email protected]
api_key:
secure: euGp3OIlxbY+ZqgJYOAE1MH4EyCVIRLxMksHcj+w/V6MEkRchLIUDE68kLdK5ZUFGHnoFQtR1N65i428gvcjy8P/0K0p9maVpZaHuk0Q2GrnIAAe0D6jZu2s2D0JPhWCZ5U4Aiek5ExhTblEYWTwOtpG/JwAa+2/IT+2DvtNf37HBM0tEvI3FLRexTv74vMDH172681UFHz2h0dvfgOzBwCiydsp6eihnV90AetsYT4Y9VpZDjAdmATO1ydLw8SnH2skWssmH8snyDDVOPkdu6mRBHZB6ckSZzyQLiIbn4dlzAt6Zi1/NjSJg4z/+vIK8o8SOHPu3AkCab+E6kBeuCBnphquIa/i3bToxJSa1AScisg+5rQZCsY/L7ey8El/nOvVn7B6xATk7w4Cm/dy5gTyriNqgFoJvDLhlntfPp+7w9GGc7Hi6UL9RWw0CCW9c2I1cyDmNpSv95gspMJAI847ykaHgXl01Cxo2yWGqwxpCR/suqdTySvo3NgqFQrM2aRkPQT+yQlL2hrrqX2l2w7gU+2y9W89WB/75x674RR3fpSID6HGrt52frZDk1mgi6ggHv0ta+hOHQCIhLM7tB/pR9ehF4RGcVjRTEBa0CG2XeXDWDFDjLEzZPmvf6vCL+PDMk91sR6YB+djsaPEwLV6pjWngYSrNdYVe1djdl8=
on:
condition: $SHOULD_DEPLOY = true
after_deploy:
- cat ~/.npm/_logs/*-debug.log
env:
global:
# PYPI_TOKEN
- secure: QCQa8tn40loCqSx9tR7PFAa7h5Gucl9IaEARiskiPF3zlLoZTst6ThnFl1rQDKx2jIJsN1z8Vwd12I4kYGED+Tgd345kE+J/n2hVEpTwSB+oOUWlwgkTQbCQB0XxPJRPila9lt3Ogpbvrp//L7IkFM06gu+N+qwQEOjn7dkLrVAkg5vl9nouuzqHadaQ1oOMG/v3DgPq5NHaCEWK0285Oqs8dqecVRSFGAtRPTDHzO/nv4stsbnmEWO1pu/SYXyxum1CYv9glfFaRNWoQ9EWjl8ogCzBsH3lkFeNhwLOcSyMFmTpXH1soXcLzJTWoUgfx9hiiC8IqOxx4nGurOK6OyY9QO8aVwyRdYlbpdLFuEiGuadfI6Rbz41TewZ+r3OmFn4gy5oRIM0fE+2Osj3btmsdZYktXdErqhRm18bV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JZjo9HZb3EMnfpupRwp14WDDrxhjX/tt4Y/rBhjQBV/DALdVcl9P20pqKGWloO8yfzw8Ytqd45kyMb7GG8xl8YH0xOiIH+yMklsIyoLAe73R47eqyDwy87AOLyR3+tZxNAqI7SwkOUXWKNoBacFkWOQsae2mBm9W5osJPMARo7HQ+0DYnpRhrRNKcxQIhdIhDAOZtGEE+n0ZeWUXeQbAEhwSLyB60kccZ0p19MTO2+61Od86gutKjNo8jSiEKvQNjedOpi3nybQOd2F18N6IrJKO/4VXMZVyl8va2rb9QRfwbfBZqGdC4VgkFBgfzI0CvkTte0BJKwzpSN3bN3MDgVWP2ttsujYVlw9RXgGF3dduekppUm+p3jUnQyZDe13VfQkT5+XtPYmZID9K+bunSYMMWwqol5ND0cCNulWDxFMKMfX5N+BpavIAwMotjH434FmB/0TyWg8lbjchgsgNsTYyxE69sW0MEAt0WeEh55yIXHPymFR7tS3EybiT0Wuj8kY3RxjM76jKMv8evk6Y6XEWArVoGeJQfWEAScorTWAA1q3JZUhhl0zTZwryhU3OwZESuwIzo=

language: python
dist: jammy
python:
Expand All @@ -18,63 +71,24 @@ before_install:
- npm ci --include=dev
- git checkout package.json package-lock.json
- git config pull.rebase false
- git fetch --depth=1 --no-tags --verbose --progress
- pip install tox cryptography requests ruff # common packages
- pip install twine # used to publish python package
- pip install pyopenssl aiohttp # used to run real-time tests
- pip install typing-extensions # required by python <3.11
- php -i | grep php.ini
- composer install
- sudo apt update
- sudo apt install apt-transport-https -y
- sudo apt update -y
- sudo apt-get install -y dotnet-sdk-7.0
- sudo apt-get install -y dotnet-runtime-7.0
- dotnet --version
- dotnet --info
- if [ "$RUNSTEP" == "PY_JS_PHP" ]; then
pip install tox cryptography requests ruff;
pip install twine;
pip install pyopenssl aiohttp;
pip install typing-extensions;
php -i | grep php.ini;
composer install;
sudo apt update;
sudo apt install apt-transport-https -y;
sudo apt update -y;
else
sudo apt-get install -y dotnet-sdk-7.0;
sudo apt-get install -y dotnet-runtime-7.0;
dotnet --version;
dotnet --info;
fi
- type -p curl >/dev/null || ( apt update && apt install curl -y)
- curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && sudo apt update && sudo apt install gh -y

script:
- ./build.sh 2>&1
- git checkout master composer.json
- if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
export SHOULD_DEPLOY=false;
DEPLOY_OUTPUT=$(env DEPLOY_CACHE=.cache/deploy SECONDS_BEFORE_NEXT_DEPLOY=43200 TRAVIS_COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE}" ./build/deploy.sh) && SHOULD_DEPLOY=true;
echo "----------------";
echo "${DEPLOY_OUTPUT}";
echo "${SHOULD_DEPLOY}";
echo "----------------";
if $SHOULD_DEPLOY; then
echo "Publishing";
npm config set git-tag-version=false && NPM_VERSION=$(npm version patch);
npm run vss && npm run copy-python-files && npm run buildCSRelease;
env COMMIT_MESSAGE=${NPM_VERSION:1} GITHUB_TOKEN=${GITHUB_TOKEN} SHOULD_TAG=${SHOULD_DEPLOY} ./build/push.sh;
./cs/deploy.sh;
cd python && env PYPI_TOKEN=${PYPI_TOKEN} ./deploy.sh && cd ..;
else
echo "Not publishing";
env COMMIT_MESSAGE="${TRAVIS_COMMIT_MESSAGE}" GITHUB_TOKEN=${GITHUB_TOKEN} SHOULD_TAG=${SHOULD_DEPLOY} ./build/push.sh;
fi;
fi
after_failure:
- sleep 10
before_deploy:
- echo $SHOULD_DEPLOY
deploy:
- provider: npm
email: [email protected]
api_key:
secure: euGp3OIlxbY+ZqgJYOAE1MH4EyCVIRLxMksHcj+w/V6MEkRchLIUDE68kLdK5ZUFGHnoFQtR1N65i428gvcjy8P/0K0p9maVpZaHuk0Q2GrnIAAe0D6jZu2s2D0JPhWCZ5U4Aiek5ExhTblEYWTwOtpG/JwAa+2/IT+2DvtNf37HBM0tEvI3FLRexTv74vMDH172681UFHz2h0dvfgOzBwCiydsp6eihnV90AetsYT4Y9VpZDjAdmATO1ydLw8SnH2skWssmH8snyDDVOPkdu6mRBHZB6ckSZzyQLiIbn4dlzAt6Zi1/NjSJg4z/+vIK8o8SOHPu3AkCab+E6kBeuCBnphquIa/i3bToxJSa1AScisg+5rQZCsY/L7ey8El/nOvVn7B6xATk7w4Cm/dy5gTyriNqgFoJvDLhlntfPp+7w9GGc7Hi6UL9RWw0CCW9c2I1cyDmNpSv95gspMJAI847ykaHgXl01Cxo2yWGqwxpCR/suqdTySvo3NgqFQrM2aRkPQT+yQlL2hrrqX2l2w7gU+2y9W89WB/75x674RR3fpSID6HGrt52frZDk1mgi6ggHv0ta+hOHQCIhLM7tB/pR9ehF4RGcVjRTEBa0CG2XeXDWDFDjLEzZPmvf6vCL+PDMk91sR6YB+djsaPEwLV6pjWngYSrNdYVe1djdl8=
on:
condition: $SHOULD_DEPLOY = true
after_deploy:
- cat ~/.npm/_logs/*-debug.log
env:
global:
# PYPI_TOKEN
- secure: QCQa8tn40loCqSx9tR7PFAa7h5Gucl9IaEARiskiPF3zlLoZTst6ThnFl1rQDKx2jIJsN1z8Vwd12I4kYGED+Tgd345kE+J/n2hVEpTwSB+oOUWlwgkTQbCQB0XxPJRPila9lt3Ogpbvrp//L7IkFM06gu+N+qwQEOjn7dkLrVAkg5vl9nouuzqHadaQ1oOMG/v3DgPq5NHaCEWK0285Oqs8dqecVRSFGAtRPTDHzO/nv4stsbnmEWO1pu/SYXyxum1CYv9glfFaRNWoQ9EWjl8ogCzBsH3lkFeNhwLOcSyMFmTpXH1soXcLzJTWoUgfx9hiiC8IqOxx4nGurOK6OyY9QO8aVwyRdYlbpdLFuEiGuadfI6Rbz41TewZ+r3OmFn4gy5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vV3njVslN52OHfI8hiBg+3PonS6vzD0HDxJZjo9HZb3EMnfpupRwp14WDDrxhjX/tt4Y/rBhjQBV/DALdVcl9P20pqKGWloO8yfzw8Ytqd45kyMb7GG8xl8YH0xOiIH+yMklsIyoLAe73R47eqyDwy87AOLyR3+tZxNAqI7SwkOUXWKNoBacFkWOQsae2mBm9W5osJPMARo7HQ+0DYnpRhrRNKcxQIhdIhDAOZtGEE+n0ZeWUXeQbAEhwSLyB60kccZ0p19MTO2+61Od86gutKjNo8jSiEKvQNjedOpi3nybQOd2F18N6IrJKO/4VXMZVyl8va2rb9QRfwbfBZqGdC4VgkFBgfzI0CvkTte0BJKwzpSN3bN3MDgVWP2ttsujYVlw9RXgGF3dduekppUm+p3jUnQyZDe13VfQkT5+XtPYmZID9K+bunSYMMWwqol5ND0cCNulWDxFMKMfX5N+BpavIAwMotjH434FmB/0TyWg8lbjchgsgNsTYyxE69sW0MEAt0WeEh55yIXHPymFR7tS3EybiT0Wuj8kY3RxjM76jKMv8evk6Y6XEWArVoGeJQfWEAScorTWAA1q3JZUhhl0zTZwryhU3OwZESuwIzo=
94 changes: 65 additions & 29 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if [ $# -gt 0 ]; then
fi

[[ -n "$TRAVIS_BUILD_ID" ]] && IS_TRAVIS="TRUE" || IS_TRAVIS="FALSE"
[[ "$RUNSTEP" == "PY_JS_PHP" ]] && IS_PYJSPHP="TRUE" || IS_PYJSPHP="FALSE"

msgPrefix="⬤ BUILD.SH : "

Expand All @@ -34,14 +35,22 @@ function run_tests {
if [ -z "$rest_pid" ]; then
if [ -z "$rest_args" ] || { [ -n "$rest_args" ] && [ "$rest_args" != "skip" ]; }; then
# shellcheck disable=SC2086
node test-commonjs.cjs && node run-tests --js --python-async --php-async --csharp --useProxy $rest_args &
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run test-pyjsphp -- $rest_args &
else
npm run test-cs -- $rest_args &
fi
local rest_pid=$!
fi
fi
if [ -z "$ws_pid" ]; then
if [ -z "$ws_args" ] || { [ -n "$ws_args" ] && [ "$ws_args" != "skip" ]; }; then
# shellcheck disable=SC2086
node run-tests --ws --js --python-async --php-async --csharp --useProxy $ws_args &
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run test-pyjsphp-ws $ws_args &
else
npm run test-cs-ws $ws_args &
fi
local ws_pid=$!
fi
fi
Expand All @@ -56,7 +65,11 @@ function run_tests {
}

build_and_test_all () {
npm run force-build
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run force-build-pyjsphp
else
npm run force-build-cs
fi
if [ "$IS_TRAVIS" = "TRUE" ]; then
merged_pull_request="$(git show --format="%s" -s HEAD | sed -nE 's/Merge pull request #([0-9]{5}).+$/\1/p')"
echo "DEBUG: $merged_pull_request" # for debugging
Expand All @@ -80,8 +93,13 @@ build_and_test_all () {
# cd ..
# fi
fi
npm run test-base
npm run test-base-ws
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run test-base-pyjsphp
npm run test-base-ws-pyjsphp
else
npm run test-base-cs
npm run test-base-ws-cs
fi
last_commit_message=$(git log -1 --pretty=%B)
echo "Last commit: $last_commit_message" # for debugging
if [[ "$last_commit_message" == *"skip-tests"* ]]; then
Expand Down Expand Up @@ -111,6 +129,7 @@ fi
diff=$(git diff origin/master --name-only)
# temporarily remove the below scripts from diff
diff=$(echo "$diff" | sed -e "s/^build\.sh//")
diff=$(echo "$diff" | sed -e "s/^run\-tests//")
diff=$(echo "$diff" | sed -e "s/^skip\-tests\.json//")
diff=$(echo "$diff" | sed -e "s/^ts\/src\/test\/static.*json//") #remove static tests and markets
# diff=$(echo "$diff" | sed -e "s/^\.travis\.yml//")
Expand Down Expand Up @@ -153,21 +172,30 @@ npm run validate-types ${REST_EXCHANGES[*]}
echo "$msgPrefix REST_EXCHANGES TO BE TRANSPILED: ${REST_EXCHANGES[*]}"
PYTHON_FILES=()
for exchange in "${REST_EXCHANGES[@]}"; do
npm run eslint "ts/src/$exchange.ts"
node build/transpile.js $exchange --force --child
node --loader ts-node/esm build/csharpTranspiler.ts $exchange
PYTHON_FILES+=("python/ccxt/$exchange.py")
PYTHON_FILES+=("python/ccxt/async_support/$exchange.py")
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run eslint "ts/src/$exchange.ts"
node build/transpile.js $exchange --force --child
PYTHON_FILES+=("python/ccxt/$exchange.py")
PYTHON_FILES+=("python/ccxt/async_support/$exchange.py")
else
node --loader ts-node/esm build/csharpTranspiler.ts $exchange
fi
done
echo "$msgPrefix WS_EXCHANGES TO BE TRANSPILED: ${WS_EXCHANGES[*]}"
for exchange in "${WS_EXCHANGES[@]}"; do
npm run eslint "ts/src/pro/$exchange.ts"
node build/transpileWS.js $exchange --force --child
node --loader ts-node/esm build/csharpTranspiler.ts $exchange --ws
PYTHON_FILES+=("python/ccxt/pro/$exchange.py")
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run eslint "ts/src/pro/$exchange.ts"
node build/transpileWS.js $exchange --force --child
PYTHON_FILES+=("python/ccxt/pro/$exchange.py")
else
node --loader ts-node/esm build/csharpTranspiler.ts $exchange --ws
fi
done
# faster version of post-transpile
npm run check-php-syntax

if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run check-php-syntax
fi

# only run the python linter if exchange related files are changed
if [ ${#PYTHON_FILES[@]} -gt 0 ]; then
Expand All @@ -185,12 +213,14 @@ if [ ${#REST_EXCHANGES[@]} -eq 0 ] && [ ${#WS_EXCHANGES[@]} -eq 0 ]; then
exit
fi

# build dotnet project
npm run buildCS

# run base tests (base js,py,php, brokerId )
# npm run test-base
npm run test-js-base && npm run test-python-base && npm run test-php-base && npm run id-tests
if [ "$IS_PYJSPHP" == "TRUE" ]; then
# build dotnet project
npm run buildCS && npm run id-tests-cs
else
# run base tests (base js,py,php, brokerId )
# npm run test-base
npm run test-js-base && npm run test-python-base && npm run test-php-base && npm run id-tests-pyjsphp
fi

# rest_args=${REST_EXCHANGES[*]} || "skip"
rest_args=$(IFS=" " ; echo "${REST_EXCHANGES[*]}") || "skip"
Expand All @@ -200,18 +230,24 @@ ws_args=$(IFS=" " ; echo "${WS_EXCHANGES[*]}") || "skip"

#request static tests
for exchange in "${REST_EXCHANGES[@]}"; do
npm run request-js -- $exchange
npm run request-py -- $exchange
php php/test/test_async.php $exchange --requestTests
npm run request-cs -- $exchange
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run request-js -- $exchange
npm run request-py -- $exchange
php php/test/test_async.php $exchange --requestTests
else
npm run request-cs -- $exchange
fi
done

#response static tests
for exchange in "${REST_EXCHANGES[@]}"; do
npm run response-js -- $exchange
npm run response-py -- $exchange
php php/test/test_async.php $exchange --responseTests
npm run response-cs -- $exchange
if [ "$IS_PYJSPHP" == "TRUE" ]; then
npm run response-js -- $exchange
npm run response-py -- $exchange
php php/test/test_async.php $exchange --responseTests
else
npm run response-cs -- $exchange
fi
done

run_tests "$rest_args" "$ws_args"