Skip to content

ci: add npm run conformance #374

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

Merged
merged 5 commits into from
Oct 27, 2021
Merged

Conversation

grant
Copy link
Contributor

@grant grant commented Oct 26, 2021

Adds command to run conformance tests:

  • npm run conformance

Very similar to the Go setup, with a few minor modifications.

Conformance package-lock.json is ignored, because it's just pointing to file:../../.

FULL LOGS

npm run conformance

> @google-cloud/[email protected] conformance
> ./run_conformance_tests.sh

Defaulting to latest client.
Use './run_conformance_tests vX.X.X' to specify a specific release version.

up to date, audited 3 packages in 866ms

found 0 vulnerabilities

========== INSTALLING CLIENT@latest ==========
Note: only works with Go 1.16+ by default, see run_conformance_tests.sh for more information.
Done installing client@latest

========== HTTP CONFORMANCE TESTS ==========
2021/10/26 16:45:24 Validating for http...
2021/10/26 16:45:24 Framework server started.
2021/10/26 16:45:29 HTTP validation started...
2021/10/26 16:45:29 HTTP validation passed!
2021/10/26 16:45:29 Framework server shut down. Wrote logs to /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stdout.txt and /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stderr.txt.
2021/10/26 16:45:29 All validation passed!

========== BACKGROUND EVENT CONFORMANCE TESTS ==========
2021/10/26 16:45:29 Validating for legacyevent...
2021/10/26 16:45:29 Framework server started.
2021/10/26 16:45:34 Legacy event validation with legacy event requests...
2021/10/26 16:45:34 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:34 Legacy event validation with CloudEvent requests...
2021/10/26 16:45:34 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:34 Legacy event validation passed!
2021/10/26 16:45:34 Framework server shut down. Wrote logs to /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stdout.txt and /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stderr.txt.
2021/10/26 16:45:34 All validation passed!

========== CLOUDEVENT CONFORMANCE TESTS ==========
2021/10/26 16:45:34 Validating for cloudevent...
2021/10/26 16:45:34 Framework server started.
2021/10/26 16:45:39 CloudEvent validation with CloudEvent requests...
2021/10/26 16:45:39 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:39 CloudEvent validation with legacy event requests...
2021/10/26 16:45:39 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:39 CloudEvent validation passed!
2021/10/26 16:45:39 Framework server shut down. Wrote logs to /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stdout.txt and /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stderr.txt.
2021/10/26 16:45:39 All validation passed!

========== DECLARATIVE HTTP CONFORMANCE TESTS ==========
2021/10/26 16:45:39 Validating for http...
2021/10/26 16:45:39 Framework server started.
2021/10/26 16:45:44 HTTP validation started...
2021/10/26 16:45:44 HTTP validation passed!
2021/10/26 16:45:44 Framework server shut down. Wrote logs to /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stdout.txt and /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stderr.txt.
2021/10/26 16:45:44 All validation passed!

========== DECLARATIVE CLOUDEVENT CONFORMANCE TESTS ==========
2021/10/26 16:45:44 Validating for cloudevent...
2021/10/26 16:45:44 Framework server started.
2021/10/26 16:45:49 CloudEvent validation with CloudEvent requests...
2021/10/26 16:45:49 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:49 CloudEvent validation with legacy event requests...
2021/10/26 16:45:49 Events tried:
        - firebase-auth (PASSED)
        - firebase-db1 (PASSED)
        - firebase-db2 (PASSED)
        - firebase-db3 (PASSED)
        - firebase-db4 (PASSED)
        - firebase-db5 (PASSED)
        - firebase-db6 (PASSED)
        - firebase-db7 (PASSED)
        - firebase-db8 (PASSED)
        - firebase-dbdelete1 (PASSED)
        - firebase-dbdelete2 (PASSED)
        - firestore_complex (PASSED)
        - firestore_simple (PASSED)
        - legacy_pubsub (PASSED)
        - pubsub_binary (PASSED)
        - pubsub_text (PASSED)
        - storage (PASSED)
2021/10/26 16:45:49 CloudEvent validation passed!
2021/10/26 16:45:49 Framework server shut down. Wrote logs to /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stdout.txt and /var/folders/27/9q8h1w651z91hycvdf4qf0h0009rgz/T/serverlog_stderr.txt.
2021/10/26 16:45:49 All validation passed!

@grant grant self-assigned this Oct 26, 2021
@google-cla google-cla bot added the cla: yes label Oct 26, 2021
@grant grant requested a review from anniefu October 26, 2021 23:54
set -e

# Navigate to the conformance tests and install the local FF.
cd test/conformance;
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] May want to put the rest of this in a subshell by adding parenthesis around the whole thing. If you run this from repo root, this would put you in this directory after, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running this from root (or even any directory within the npm package), I don't see the directory changing.

I believe npm scripts spawn a shell process under the hood, so npm run X will start a new shell, run, then exit.

CONTRIBUTING.md Outdated
@@ -34,6 +34,14 @@ To run an individual test, you can run a command such as the following:
npm run test -- -g 'loading function'
```

### Conformance Tests

To run the conformance tests, run:
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a note about needing to install Go 1.16 first?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I added a note there.

Copy link
Member

@matthewrobertson matthewrobertson left a comment

Choose a reason for hiding this comment

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

LGTM

@grant grant added the automerge Summon MOG for automerging label Oct 27, 2021
@gcf-merge-on-green gcf-merge-on-green bot merged commit 8110d3a into master Oct 27, 2021
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Summon MOG for automerging label Oct 27, 2021
@grant grant deleted the grant_conformance_local branch November 18, 2021 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants