Skip to content

Commit

Permalink
fix(oas): add open api spec tests to CI and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Arqu committed Apr 30, 2021
1 parent ee7d882 commit e91b50b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
command: |
trap "go-junit-report <${TEST_RESULTS}/go-test.out > ${TEST_RESULTS}/go-test-report.xml" EXIT
make test | tee ${TEST_RESULTS}/go-test.out
- run:
name: Run OAS Spec Tests
command: |
cd docs && go test ./...
- save_cache:
key: dependency-cache-{{ checksum "go.sum" }}
paths:
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ test-all-coverage:
./.circleci/cover.test.sh

cli-docs:
go run docs/docs.go --dir temp --filename cli_commands.md
cd docs && go run . --dir ../temp --filename cli_commands.md

api-spec:
cd docs && go run . --dir ../temp --apiOnly

update-changelog:
conventional-changelog -p angular -i CHANGELOG.md -s
11 changes: 6 additions & 5 deletions docs/api_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"strings"
"text/template"

"github.com/qri-io/qri/api"
"github.com/qri-io/qri/lib"
"github.com/qri-io/qri/version"
)
Expand Down Expand Up @@ -213,7 +214,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
m := libMethod{
MethodSet: "api",
MethodName: "unpack",
Endpoint: lib.AEUnpack,
Endpoint: api.AEUnpack,
HTTPVerb: "post",
Params: qriType{
Name: "application/zip",
Expand All @@ -230,7 +231,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
m = libMethod{
MethodSet: "api",
MethodName: "home",
Endpoint: lib.AEHome,
Endpoint: api.AEHome,
HTTPVerb: "get",
Params: qriType{},
Paginated: false,
Expand All @@ -244,7 +245,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
m = libMethod{
MethodSet: "api",
MethodName: "health",
Endpoint: lib.AEHealth,
Endpoint: api.AEHealth,
HTTPVerb: "get",
Params: qriType{},
Paginated: false,
Expand All @@ -258,7 +259,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
m = libMethod{
MethodSet: "api",
MethodName: "webui",
Endpoint: lib.AEWebUI,
Endpoint: api.AEWebUI,
HTTPVerb: "get",
Params: qriType{},
Paginated: false,
Expand All @@ -272,7 +273,7 @@ func addNonLibMethods(methods []libMethod) []libMethod {
m = libMethod{
MethodSet: "api",
MethodName: "ipfs",
Endpoint: lib.AEIPFS,
Endpoint: api.AEIPFS,
HTTPVerb: "get",
Params: qriType{
Name: "pathParams",
Expand Down
2 changes: 2 additions & 0 deletions docs/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ require (
github.com/spf13/cobra v1.1.3
gopkg.in/yaml.v2 v2.4.0
)

replace github.com/qri-io/qri => ../

0 comments on commit e91b50b

Please sign in to comment.