Skip to content

Commit

Permalink
Add conformance test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Jun 23, 2023
1 parent 9423f87 commit 34897df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/conformance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ jobs:
run: npm install

- name: Install conformance client
uses: GoogleCloudPlatform/functions-framework-conformance/.github/actions/client/install@1975792fb34ebbfa058d690666186d669d3a5977 # v1.8.0
uses: GoogleCloudPlatform/functions-framework-conformance/.github/actions/client/install@5f2a796b58f099d749e70ecc83f531f6701c64af # v1.8.3
with:
client-version: v1.7.0
client-version: v1.8.2
cache-path: ~/client
cache-key: conformance-client-v1.7.0
cache-key: conformance-client-v1.8.2

- name: Run HTTP conformance tests using legacy API
working-directory: 'test/conformance'
Expand Down Expand Up @@ -73,6 +73,16 @@ jobs:
-validate-mapping=false \
-cmd="npm start -- --target=writeHttpDeclarative"
- name: Run Typed conformance tests using declarative API
working-directory: 'test/conformance'
run: |
~/client \
-type=http \
-declarative-type=typed \
-buildpacks=false \
-validate-mapping=false \
-cmd="npm start -- --target=writeTypedDeclarative"
- name: Run cloudevent conformance tests using declarative API
working-directory: 'test/conformance'
run: |
Expand Down
6 changes: 6 additions & 0 deletions test/conformance/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ functions.http('writeHttpDeclarative', (req, res) => {
res.sendStatus(200);
});

functions.typed('writeTypedDeclarative', req => {
return {
payload: req,
};
});

functions.cloudEvent('writeCloudEventDeclarative', cloudEvent => {
cloudEvent.datacontenttype = 'application/json';
writeJson(cloudEvent);
Expand Down

0 comments on commit 34897df

Please sign in to comment.