Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v4
with:
version: ^10.0.0
- run: node --version
- run: pnpm install
- run: ci/run_conditional_tests.sh
name: Run unit tests
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
TURBO_TELEMETRY_DISABLED: 1
4 changes: 2 additions & 2 deletions .github/workflows/windows-presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v4
with:
version: ^10.0.0
- run: node --version
- run: pnpm install
- run: bash ci/run_conditional_tests.sh
name: Run windows unit tests
shell: bash
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
TURBO_TELEMETRY_DISABLED: 1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
**/node_modules
.coverage
.nyc_output
.turbo
docs/json
packages/google-cloud/README.md
packages/*/AUTHORS
Expand Down
36 changes: 28 additions & 8 deletions ci/run_conditional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ set -e
if [[ "${changed}" -eq 0 ]]; then
echo "no change detected in ci"
else
echo "skipping trigger of tests for now: tracking in #7540"
# echo "change detected in ci, we should test everything"
# echo "result of git diff ${GIT_DIFF_ARG} ci:"
# git diff ${GIT_DIFF_ARG} ci
# GIT_DIFF_ARG=""
# echo "skipping trigger of tests for now: tracking in #7540"
echo "change detected in ci, we should test everything"
echo "result of git diff ${GIT_DIFF_ARG} ci:"
git diff ${GIT_DIFF_ARG} ci
GIT_DIFF_ARG=""
fi

# Now we have a fixed list, but we can change it to autodetect if
# necessary.
#
# Note the package and .github/scripts tests are executed in parallel
# using turbo.

subdirs=(
core
containers
packages
handwritten
.github/scripts
)

RETVAL=0
Expand All @@ -92,6 +92,25 @@ tests_with_credentials="packages/google-analytics-admin/ packages/google-area120
# Until these packages can be updated to be OS agnostic, we will skip them on Windows.
windows_exempt_tests=".github/scripts/fixtures/ .github/scripts/tests/ packages/gapic-node-processing/ packages/typeless-sample-bot/"

if [[ "${TEST_TYPE}" == "units" ]]; then
cd ${PROJECT_ROOT}

echo "installing turbo . . ."
pnpm install -g turbo

echo "running all unit tests for packages"
set +e
turbo run test
ret=$?
set -e

echo "turbo testing complete with code ${ret}"

if [ ${ret} -ne 0 ]; then
exit ${ret}
fi
fi

for subdir in ${subdirs[@]}; do
for d in `ls -d ${subdir}/*/`; do
if [ -f "ignore.json" ] && jq -e ".ignored[] | select(. == \"$d\")" ignore.json > /dev/null; then
Expand Down Expand Up @@ -154,6 +173,7 @@ for subdir in ${subdirs[@]}; do
ret=$?
set -e
if [ ${ret} -ne 0 ]; then
echo "test failed in ${d} with code ${ret}"
RETVAL=${ret}
# Since there are so many APIs, we should exit early if there's an error
break
Expand Down
14 changes: 7 additions & 7 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,29 @@ if [ ${BUILD_TYPE} != "presubmit" ]; then
fi

# Install dependencies
echo "pnpm install --ignore-scripts --engine-strict --prod; pnpm install"
pnpm install --ignore-scripts --engine-strict --prod; pnpm install
echo "npm install --ignore-scripts --engine-strict --prod; npm install"
npm install --ignore-scripts --engine-strict --prod; npm install


retval=0

set +e
case ${TEST_TYPE} in
lint)
pnpm prelint
pnpm lint
npm run prelint
npm run lint
retval=$?
;;
samples)
pnpm samples-test
npm run samples-test
retval=$?
;;
system)
pnpm system-test
npm run system-test
retval=$?
;;
units)
pnpm test
npm run test
retval=$?
;;
*)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@
},
"engines": {
"node": ">=18"
}
},
"packageManager": "pnpm@10.0.0"
}
Loading
Loading