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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/actions/run-unit-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ runs:
restore-keys: |
${{ runner.os }}-turbo-
- name: Compile Workspace (Turborepo Caching)
run: pnpm run compile
run: pnpm run compile || pnpm run compile
shell: bash
- run: node --version
shell: bash
Expand Down
40 changes: 29 additions & 11 deletions .github/workflows/generator-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
run: |
mkdir -p ~/artifacts
cp bazel-testlogs/unit_tests/test.outputs/outputs.zip ~/artifacts/
bazelisk run -- @pnpm//:pnpm --dir $PWD install
bazelisk run -- @pnpm//:pnpm --dir $PWD install --ignore-workspace
tar cfz ~/artifacts/node_modules.tar.gz node_modules

- name: Save artifacts
Expand All @@ -82,25 +82,34 @@ jobs:

- name: Test generated libraries
working-directory: core/generator/gapic-generator-typescript
shell: bash
run: |
set -ex
npm install -g pnpm@10.0.0 --silent
cp ../../../.mocharc.cjs .
unzip ~/artifacts/outputs.zip -d library
FAIL=0
PIDS=()
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
(
set -ex
echo "--- Testing library $lib ---"
cd library/.test-out-$lib
pnpm install --no-frozen-lockfile --silent
cd "library/.test-out-$lib"
pnpm install --no-frozen-lockfile --ignore-workspace --silent
pnpm test
pnpm run compile
pnpm run system-test
) &
PIDS+=($!)
if [ "${#PIDS[@]}" -ge 4 ]; then
for pid in "${PIDS[@]}"; do
wait "$pid" || FAIL=1
done
PIDS=()
fi
done
for job in $(jobs -p); do
wait "$job" || FAIL=1
for pid in "${PIDS[@]}"; do
wait "$pid" || FAIL=1
done
if [ "$FAIL" -ne 0 ]; then
echo "Some library tests failed!"
Expand All @@ -109,23 +118,32 @@ jobs:

- name: Test generated ESM libraries
working-directory: core/generator/gapic-generator-typescript
shell: bash
run: |
set -ex
cp ../../../.mocharc.cjs .
FAIL=0
PIDS=()
for lib in showcase kms translate monitoring dlp texttospeech showcase-legacy compute logging bigquery-v2 redis retail; do
(
set -ex
echo "--- Testing ESM library $lib ---"
cd library/.test-out-$lib-esm
pnpm install --no-frozen-lockfile --silent
cd "library/.test-out-$lib-esm"
pnpm install --no-frozen-lockfile --ignore-workspace --silent
pnpm test
pnpm run compile
pnpm run system-test
) &
PIDS+=($!)
if [ "${#PIDS[@]}" -ge 4 ]; then
for pid in "${PIDS[@]}"; do
wait "$pid" || FAIL=1
done
PIDS=()
fi
done
for job in $(jobs -p); do
wait "$job" || FAIL=1
for pid in "${PIDS[@]}"; do
wait "$pid" || FAIL=1
done
if [ "$FAIL" -ne 0 ]; then
echo "Some ESM library tests failed!"
Expand All @@ -142,7 +160,7 @@ jobs:
run: |
set -ex
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-speech
pnpm install --no-frozen-lockfile --silent
pnpm install --no-frozen-lockfile --ignore-workspace --silent
pnpm test
pnpm run system-test

Expand All @@ -157,6 +175,6 @@ jobs:
run: |
set -ex
cd generator/gapic-generator-typescript/test-fixtures/google-cloud-tasks
pnpm install --no-frozen-lockfile --silent
pnpm install --no-frozen-lockfile --ignore-workspace --silent
pnpm test
pnpm run system-test
4 changes: 3 additions & 1 deletion .nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": [
"lcov"
],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,14 @@ with an issue in this repository.

1. Install dependencies:

npm install
pnpm install

1. Run the tests:

npm test
pnpm run test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
1 change: 0 additions & 1 deletion core/common/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ system-test/*key.json
*-lock.js*
build/
.vscode
package-lock.json
__pycache__
4 changes: 3 additions & 1 deletion core/common/.nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": [
"lcov"
],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
10 changes: 5 additions & 5 deletions core/common/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ accept your pull requests.

1. Install dependencies:

npm install
pnpm install

1. Run the tests:

# Run unit tests.
npm test
pnpm run test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In this file (and many other CONTRIBUTING.md files across the repository), the command npm run samples-test on line 61 was missed during the migration from npm to pnpm. Please update it to pnpm run samples-test for consistency.


# Run sample integration tests.
npm run samples-test
pnpm run samples-test

# Run all system tests.
npm run system-test
pnpm run system-test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
[projects]: https://console.cloud.google.com/project
Expand Down
1 change: 0 additions & 1 deletion core/dev-packages/jsdoc-fresh/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
package-lock.json
__pycache__
docs
.DS_Store
4 changes: 3 additions & 1 deletion core/dev-packages/jsdoc-fresh/.nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": [
"lcov"
],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
10 changes: 5 additions & 5 deletions core/dev-packages/jsdoc-fresh/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ accept your pull requests.

1. Install dependencies:

npm install
pnpm install

1. Run the tests:

# Run unit tests.
npm test
pnpm run test

# Run sample integration tests.
npm run samples-test
pnpm run samples-test

# Run all system tests.
npm run system-test
pnpm run system-test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
[projects]: https://console.cloud.google.com/project
Expand Down
1 change: 0 additions & 1 deletion core/dev-packages/jsdoc-region-tag/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node_modules
.DS_Store
coverage
package-lock.json
.coverage
docs
4 changes: 3 additions & 1 deletion core/dev-packages/jsdoc-region-tag/.nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": [
"lcov"
],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
10 changes: 5 additions & 5 deletions core/dev-packages/jsdoc-region-tag/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ accept your pull requests.

1. Install dependencies:

npm install
pnpm install

1. Run the tests:

# Run unit tests.
npm test
pnpm run test

# Run sample integration tests.
npm run samples-test
pnpm run samples-test

# Run all system tests.
npm run system-test
pnpm run system-test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
[projects]: https://console.cloud.google.com/project
Expand Down
2 changes: 0 additions & 2 deletions core/dev-packages/pack-n-play/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ build
node_modules
.nyc_output
.coverage/*
test/fixtures/**/package-lock.json
package-lock.json
4 changes: 3 additions & 1 deletion core/dev-packages/pack-n-play/.nycrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": [
"lcov"
],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
10 changes: 5 additions & 5 deletions core/dev-packages/pack-n-play/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ accept your pull requests.

1. Install dependencies:

npm install
pnpm install

1. Run the tests:

# Run unit tests.
npm test
pnpm run test

# Run sample integration tests.
npm run samples-test
pnpm run samples-test

# Run all system tests.
npm run system-test
pnpm run system-test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
[projects]: https://console.cloud.google.com/project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ accept your pull requests.

1. Install dependencies:

npm install
pnpm install

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It appears that CONTRIBUTING.md (and potentially .gitignore files) in the baseline and test-fixture directories are being manually updated here. According to the repository rules, manual edits to auto-generated files or baseline files should be avoided as they will be overwritten during the next regeneration. Please ensure that the upstream generator templates (or the source files used by the generator) are updated instead, and then regenerate these baseline/test-fixture files.

References
  1. Do not manually edit auto-generated files to fix typos or make other changes, as these edits will be overwritten during the next regeneration. Instead, apply the fixes upstream in the generator or templates.


1. Run the tests:

# Run unit tests.
npm test
pnpm run test

# Run sample integration tests.
npm run samples-test
pnpm run samples-test

# Run all system tests.
npm run system-test
pnpm run system-test

1. Lint (and maybe fix) any changes:

npm run fix
pnpm run fix

[setup]: https://cloud.google.com/nodejs/docs/setup
[projects]: https://console.cloud.google.com/project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"report-dir": "./.coverage",
"reporter": ["text", "lcov"],
"reporter": ["lcov"],
"exclude": [
"**/*-test",
"**/.coverage",
Expand Down
Loading
Loading