Skip to content

Commit

Permalink
Revert "travis: Choose schema based on USE_OLD_SCHEMA file" (#1193)
Browse files Browse the repository at this point in the history
This reverts commit a866c43.

Observe that there are no more USE_OLD_SCHEMA files in this repository.
This indicates that henceforth all canonical-data.json files should use
the schema proposed in
#996 and
defined in #1074.
  • Loading branch information
petertseng authored Feb 16, 2018
1 parent f079c2d commit bc83b99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 178 deletions.
42 changes: 1 addition & 41 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,4 @@ cache: yarn

script:
- bin/check_required_files_present
- |
invalid_old=""
invalid_new=""
forgotten=""
for json in exercises/*/canonical-data.json; do
dir=$(dirname $json)
ex=$(basename $dir)
if [ -f "$dir/USE_OLD_SCHEMA" ]; then
if ! ajv -s old-schema.json -d $json; then
invalid_old="$invalid_old $ex"
fi
# If we have converted to new,
# make sure we don't forget to remove USE_OLD_SCHEMA file!
if ajv -s canonical-schema.json -d $json 2>/dev/null; then
forgotten="$forgotten $ex"
fi
else
if ! ajv -s canonical-schema.json -d $json; then
invalid_new="$invalid_new $ex"
fi
fi
done
stat=0
if [ -n "$invalid_old" ]; then
echo "Exercises using old schema, but invalid: $invalid_old"
stat=1
fi
if [ -n "$invalid_new" ]; then
echo "Exercises using new schema, but invalid: $invalid_new"
stat=1
fi
if [ -n "$forgotten" ]; then
echo "Exercises using new schema, but forgot to remove USE_OLD_SCHEMA file: $forgotten"
stat=1
fi
exit $stat
- yarn test
137 changes: 0 additions & 137 deletions old-schema.json

This file was deleted.

0 comments on commit bc83b99

Please sign in to comment.