Skip to content

Commit 900a643

Browse files
authored
test: fix tests (#73)
no functional changes, but the use of first/last name were violating linter rules. also switching to a test script for CI which runs all tests, to simplify local execution of CI tests.
1 parent 6485221 commit 900a643

File tree

8 files changed

+640
-643
lines changed

8 files changed

+640
-643
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,7 @@ jobs:
1919
- name: Check out code
2020
uses: actions/checkout@v2
2121

22-
- name: "test: no change to generated files."
22+
- name: "test: all tests"
2323
run: |
2424
go install github.com/bufbuild/buf/cmd/buf@v1.42.0
25-
./scripts/verify-goldens.sh
26-
27-
- name: "test: example server function"
28-
run: |
29-
./scripts/test_http_api.sh
30-
31-
- name: run OAS api-linter
32-
run: |
33-
./scripts/run-oas-linter.sh
34-
35-
- name: run protobuf api-linter
36-
run: |
37-
./scripts/run-proto-linter.sh
25+
./scripts/test-all.sh

example/bookstore/v1/bookstore.pb.go

Lines changed: 611 additions & 611 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/bookstore/v1/bookstore.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ message Book {
272272

273273
// A Author.
274274
message Author {
275-
// Field for first_name.
276-
string first_name = 1 [json_name = "first_name"];
275+
// Field for given_name.
276+
string given_name = 1 [json_name = "given_name"];
277277

278-
// Field for last_name.
279-
string last_name = 2 [json_name = "last_name"];
278+
// Field for family_name.
279+
string family_name = 2 [json_name = "family_name"];
280280
}
281281

282282
// Field for isbn.

example/bookstore/v1/bookstore.swagger.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,13 +1376,13 @@
13761376
"BookAuthor": {
13771377
"type": "object",
13781378
"properties": {
1379-
"first_name": {
1379+
"given_name": {
13801380
"type": "string",
1381-
"description": "Field for first_name."
1381+
"description": "Field for given_name."
13821382
},
1383-
"last_name": {
1383+
"family_name": {
13841384
"type": "string",
1385-
"description": "Field for last_name."
1385+
"description": "Field for family_name."
13861386
}
13871387
},
13881388
"description": "A Author."

example/bookstore/v1/bookstore.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ resources:
5454
items:
5555
type: object
5656
properties:
57-
first_name:
57+
given_name:
5858
type: string
5959
x-aep-field-number: 1
60-
last_name:
60+
family_name:
6161
type: string
6262
x-aep-field-number: 2
6363
methods:

example/bookstore/v1/bookstore_openapi.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,13 +1348,13 @@
13481348
"items": {
13491349
"type": "object",
13501350
"properties": {
1351-
"first_name": {
1351+
"family_name": {
13521352
"type": "string",
1353-
"x-aep-field-number": 1
1353+
"x-aep-field-number": 2
13541354
},
1355-
"last_name": {
1355+
"given_name": {
13561356
"type": "string",
1357-
"x-aep-field-number": 2
1357+
"x-aep-field-number": 1
13581358
}
13591359
}
13601360
},

example/bookstore/v1/bookstore_openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ components:
55
author:
66
items:
77
properties:
8-
first_name:
9-
type: string
10-
x-aep-field-number: 1
11-
last_name:
8+
family_name:
129
type: string
1310
x-aep-field-number: 2
11+
given_name:
12+
type: string
13+
x-aep-field-number: 1
1414
type: object
1515
type: array
1616
x-aep-field-number: 5

scripts/test-all.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd)
5+
6+
"${SCRIPT_DIR}"/verify-goldens.sh
7+
"${SCRIPT_DIR}"/test_http_api.sh
8+
"${SCRIPT_DIR}"/run-oas-linter.sh
9+
"${SCRIPT_DIR}"/run-proto-linter.sh

0 commit comments

Comments
 (0)