File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 4949 useBuildpacks : false
5050 validateMapping : true
5151 cmd : " 'functions-framework --source tests/conformance/main.py --target write_cloud_event --signature-type cloudevent'"
52+
53+ - name : Run HTTP conformance tests declarative
54+ uses : GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0
55+ with :
56+ version : ' v1.1.0'
57+ functionType : ' http'
58+ useBuildpacks : false
59+ validateMapping : false
60+ cmd : " 'functions-framework --source tests/conformance/main.py --target write_http_declarative'"
61+
62+ - name : Run cloudevent conformance tests declarative
63+ uses : GoogleCloudPlatform/functions-framework-conformance/action@v1.1.0
64+ with :
65+ version : ' v1.1.0'
66+ functionType : ' cloudevent'
67+ useBuildpacks : false
68+ validateMapping : true
69+ cmd : " 'functions-framework --source tests/conformance/main.py --target write_cloudevent_declarative'"
Original file line number Diff line number Diff line change 22
33from cloudevents .http import to_json
44
5+ import functions_framework
6+
57filename = "function_output.json"
68
79
@@ -33,3 +35,14 @@ def write_legacy_event(data, context):
3335
3436def write_cloud_event (cloudevent ):
3537 _write_output (to_json (cloudevent ).decode ())
38+
39+
40+ @functions_framework .http
41+ def write_http_declarative (request ):
42+ _write_output (json .dumps (request .json ))
43+ return "OK" , 200
44+
45+
46+ @functions_framework .cloudevent
47+ def write_cloudevent_declarative (cloudevent ):
48+ _write_output (to_json (cloudevent ).decode ())
You can’t perform that action at this time.
0 commit comments