Skip to content

Commit e91b50b

Browse files
committed
fix(oas): add open api spec tests to CI and makefile
1 parent ee7d882 commit e91b50b

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.circleci/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
command: |
3232
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
3333
make test | tee ${TEST_RESULTS}/go-test.out
34+
- run:
35+
name: Run OAS Spec Tests
36+
command: |
37+
cd docs && go test ./...
3438
- save_cache:
3539
key: dependency-cache-{{ checksum "go.sum" }}
3640
paths:

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ test-all-coverage:
5252
./.circleci/cover.test.sh
5353

5454
cli-docs:
55-
go run docs/docs.go --dir temp --filename cli_commands.md
55+
cd docs && go run . --dir ../temp --filename cli_commands.md
56+
57+
api-spec:
58+
cd docs && go run . --dir ../temp --apiOnly
5659

5760
update-changelog:
5861
conventional-changelog -p angular -i CHANGELOG.md -s

docs/api_docs.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"strings"
1515
"text/template"
1616

17+
"github.com/qri-io/qri/api"
1718
"github.com/qri-io/qri/lib"
1819
"github.com/qri-io/qri/version"
1920
)
@@ -213,7 +214,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
213214
m := libMethod{
214215
MethodSet: "api",
215216
MethodName: "unpack",
216-
Endpoint: lib.AEUnpack,
217+
Endpoint: api.AEUnpack,
217218
HTTPVerb: "post",
218219
Params: qriType{
219220
Name: "application/zip",
@@ -230,7 +231,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
230231
m = libMethod{
231232
MethodSet: "api",
232233
MethodName: "home",
233-
Endpoint: lib.AEHome,
234+
Endpoint: api.AEHome,
234235
HTTPVerb: "get",
235236
Params: qriType{},
236237
Paginated: false,
@@ -244,7 +245,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
244245
m = libMethod{
245246
MethodSet: "api",
246247
MethodName: "health",
247-
Endpoint: lib.AEHealth,
248+
Endpoint: api.AEHealth,
248249
HTTPVerb: "get",
249250
Params: qriType{},
250251
Paginated: false,
@@ -258,7 +259,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
258259
m = libMethod{
259260
MethodSet: "api",
260261
MethodName: "webui",
261-
Endpoint: lib.AEWebUI,
262+
Endpoint: api.AEWebUI,
262263
HTTPVerb: "get",
263264
Params: qriType{},
264265
Paginated: false,
@@ -272,7 +273,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
272273
m = libMethod{
273274
MethodSet: "api",
274275
MethodName: "ipfs",
275-
Endpoint: lib.AEIPFS,
276+
Endpoint: api.AEIPFS,
276277
HTTPVerb: "get",
277278
Params: qriType{
278279
Name: "pathParams",

docs/go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ require (
1010
github.com/spf13/cobra v1.1.3
1111
gopkg.in/yaml.v2 v2.4.0
1212
)
13+
14+
replace github.com/qri-io/qri => ../

0 commit comments

Comments
 (0)