-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to validate test cases against the problem specifications. (#450)
* Script to validate test cases against the problem specifications. Identifies test cases from the problem spec canonical data that are unimplemented. * No need to reimplement what the canonical-data-syncer does * canonical-data-syncer requires config.json to be in good shape
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
bin/configlet | ||
bin/configlet.exe | ||
bin/canonical_data_syncer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
die() { echo "$*" >&2; exit 1; } | ||
|
||
cd "$(dirname "$0")"/.. || die "cannot cd" | ||
|
||
bin/fetch_configlet || die "cannot fetch configlet" | ||
bin/configlet lint . || die "resolve config.json problems first" | ||
|
||
bin/fetch-canonical_data_syncer || die "cannot fetch canonical_data_syncer" | ||
bin/canonical_data_syncer --check "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
readonly LATEST='https://api.github.com/repos/exercism/canonical-data-syncer/releases/latest' | ||
|
||
case "$(uname)" in | ||
(Darwin*) OS='mac' ;; | ||
(Linux*) OS='linux' ;; | ||
(Windows*) OS='windows' ;; | ||
(MINGW*) OS='windows' ;; | ||
(MSYS_NT-*) OS='windows' ;; | ||
(*) OS='linux' ;; | ||
esac | ||
|
||
case "$OS" in | ||
(windows*) EXT='zip' ;; | ||
(*) EXT='tgz' ;; | ||
esac | ||
|
||
case "$(uname -m)" in | ||
(*64*) ARCH='64bit' ;; | ||
(*686*) ARCH='32bit' ;; | ||
(*386*) ARCH='32bit' ;; | ||
(*) ARCH='64bit' ;; | ||
esac | ||
|
||
if [ -z "${GITHUB_TOKEN}" ] | ||
then | ||
HEADER='' | ||
else | ||
HEADER="authorization: Bearer ${GITHUB_TOKEN}" | ||
fi | ||
|
||
FILENAME="canonical_data_syncer-${OS}-${ARCH}.${EXT}" | ||
|
||
get_url () { | ||
curl --header "$HEADER" -s "$LATEST" | | ||
awk -v filename=$FILENAME '$1 ~ /browser_download_url/ && $2 ~ filename { print $2 }' | | ||
tr -d '"' | ||
} | ||
|
||
URL=$(get_url) | ||
|
||
case "$EXT" in | ||
(*zip) | ||
curl --header "$HEADER" -s --location "$URL" -o bin/latest-canonical_data_syncer.zip | ||
unzip bin/latest-canonical_data_syncer.zip -d bin/ | ||
rm bin/latest-canonical_data_syncer.zip | ||
;; | ||
(*) curl --header "$HEADER" -s --location "$URL" | tar xz -C bin/ ;; | ||
esac |