Skip to content

Commit 98ced7e

Browse files
committed
update fixtures and move to travis
1 parent e931a23 commit 98ced7e

File tree

8 files changed

+76
-54
lines changed

8 files changed

+76
-54
lines changed

.drone.sec

-1
This file was deleted.

.drone.yml

-40
This file was deleted.

.pullapprove.yml

-13
This file was deleted.

.travis.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: go
2+
go:
3+
- 1.7
4+
install:
5+
- go get -u github.com/axw/gocov/gocov
6+
- go get -u gopkg.in/matm/v1/gocov-html
7+
- go get -u github.com/cee-dub/go-junit-report
8+
- go get -u github.com/stretchr/testify/assert
9+
- go get -u gopkg.in/yaml.v2
10+
- go get -u github.com/go-openapi/analysis
11+
- go get -u github.com/go-openapi/errors
12+
- go get -u github.com/go-openapi/loads
13+
- go get -u github.com/go-openapi/strfmt
14+
- go get -u github.com/go-openapi/runtime
15+
script:
16+
- go test -v -race -cover -coverprofile=coverage.txt -covermode=atomic
17+
after_success:
18+
- bash <(curl -s https://codecov.io/bash)
19+
notifications:
20+
slack:
21+
secure: EmObnQuM9Mw8J9vpFaKKHqSMN4Wsr/A9+v7ewAD5cEhA0T1P4m7MbJMiJOhxUhj/X+BFh2DamW+P2lT8mybj5wg8wnkQ2BteKA8Tawi6f9PRw2NRheO8tAi8o/npLnlmet0kc93mn+oLuqHw36w4+j5mkOl2FghkfGiUVhwrhkCP7KXQN+3TU87e+/HzQumlJ3nsE+6terVxkH3PmaUTsS5ONaODZfuxFpfb7RsoEl3skHf6d+tr+1nViLxxly7558Nc33C+W1mr0qiEvMLZ+kJ/CpGWBJ6CUJM3jm6hNe2eMuIPwEK2hxZob8c7n22VPap4K6a0bBRoydoDXaba+2sD7Ym6ivDO/DVyL44VeBBLyIiIBylDGQdZH+6SoWm90Qe/i7tnY/T5Ao5igT8f3cfQY1c3EsTfqmlDfrhmACBmwSlgkdVBLTprHL63JMY24LWmh4jhxsmMRZhCL4dze8su1w6pLN/pD1pGHtKYCEVbdTmaM3PblNRFf12XB7qosmQsgUndH4Vq3bTbU0s1pKjeDhRyLvFzvR0TBbo0pDLEoF1A/i5GVFWa7yLZNUDudQERRh7qv/xBl2excIaQ1sV4DSVm7bAE9l6Kp+yeHQJW2uN6Y3X8wu9gB9nv9l5HBze7wh8KE6PyWAOLYYqZg9/sAtsv/2GcQqXcKFF1zcA=

fixtures/jsonschema_suite/ref.json

+20
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,25 @@
155155
"valid": false
156156
}
157157
]
158+
},
159+
{
160+
"description": "property named $ref that is not a reference",
161+
"schema": {
162+
"properties": {
163+
"$ref": {"type": "string"}
164+
}
165+
},
166+
"tests": [
167+
{
168+
"description": "property named $ref valid",
169+
"data": {"$ref": "a"},
170+
"valid": true
171+
},
172+
{
173+
"description": "property named $ref invalid",
174+
"data": {"$ref": 2},
175+
"valid": false
176+
}
177+
]
158178
}
159179
]

fixtures/jsonschema_suite/required.json

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"description": "non-present required property is invalid",
1919
"data": {"bar": 1},
2020
"valid": false
21+
},
22+
{
23+
"description": "ignores non-objects",
24+
"data": 12,
25+
"valid": true
2126
}
2227
]
2328
},

fixtures/jsonschema_suite/type.json

+15
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
"data": "foo",
1919
"valid": false
2020
},
21+
{
22+
"description": "a string is still not an integer, even if it looks like one",
23+
"data": "1",
24+
"valid": false
25+
},
2126
{
2227
"description": "an object is not an integer",
2328
"data": {},
@@ -59,6 +64,11 @@
5964
"data": "foo",
6065
"valid": false
6166
},
67+
{
68+
"description": "a string is still not a number, even if it looks like one",
69+
"data": "1",
70+
"valid": false
71+
},
6272
{
6373
"description": "an object is not a number",
6474
"data": {},
@@ -100,6 +110,11 @@
100110
"data": "foo",
101111
"valid": true
102112
},
113+
{
114+
"description": "a string is still a string, even if it looks like a number",
115+
"data": "1",
116+
"valid": true
117+
},
103118
{
104119
"description": "an object is not a string",
105120
"data": {},

update-fixtures.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
set -eu -o pipefail
4+
dir=$(git rev-parse --show-toplevel)
5+
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
6+
7+
function finish {
8+
rm -rf "$scratch"
9+
}
10+
trap finish EXIT SIGHUP SIGINT SIGTERM
11+
12+
cd "$scratch"
13+
git clone https://github.com/json-schema-org/JSON-Schema-Test-Suite Suite
14+
cp -r Suite/tests/draft4/* "$dir/fixtures/jsonschema_suite"
15+
cp -a Suite/remotes "$dir/fixtures/jsonschema_suite"

0 commit comments

Comments
 (0)