2019-05-28 15:59:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Automatically update all SourceCred snapshot data.
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
toplevel="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
|
|
|
|
cd "${toplevel}"
|
|
|
|
|
2019-06-05 06:26:52 +00:00
|
|
|
tmpdir="$(mktemp -d)"
|
|
|
|
cleanup() {
|
|
|
|
rm -r "${tmpdir}"
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
SOURCECRED_BIN="${tmpdir}/bin"
|
|
|
|
yarn run --silent backend --output-path "${SOURCECRED_BIN}"
|
|
|
|
export SOURCECRED_BIN # for Sharness and shell tests
|
|
|
|
export NODE_PATH="${toplevel}/node_modules${NODE_PATH:+:${NODE_PATH}}"
|
|
|
|
|
|
|
|
echo "Updating GitHub GraphQL Flow types"
|
|
|
|
cp .prettierrc.json "${SOURCECRED_BIN}/"
|
|
|
|
node "${SOURCECRED_BIN}/generateGithubGraphqlFlowTypes.js" \
|
|
|
|
>src/plugins/github/graphqlTypes.js
|
|
|
|
|
|
|
|
echo "Updating sharness/test_load_example_github.t"
|
2019-05-28 15:59:50 +00:00
|
|
|
(cd sharness; UPDATE_SNAPSHOT=1 ./test_load_example_github.t -l)
|
2019-06-05 06:26:52 +00:00
|
|
|
|
2019-07-14 16:05:13 +00:00
|
|
|
echo "Updating sharness/test_cli_scores.t"
|
|
|
|
(cd sharness; UPDATE_SNAPSHOT=1 ./test_cli_scores.t -l)
|
|
|
|
|
2019-05-28 15:59:50 +00:00
|
|
|
echo "Updating git/loadRepositoryTest.sh"
|
2019-06-05 06:26:52 +00:00
|
|
|
./src/plugins/git/loadRepositoryTest.sh -u --no-build
|
|
|
|
|
2019-05-28 15:59:50 +00:00
|
|
|
echo "Updating github/fetchGithubOrgTest.sh"
|
|
|
|
./src/plugins/github/fetchGithubOrgTest.sh -u --no-build
|
2019-06-05 06:26:52 +00:00
|
|
|
|
2019-05-28 15:59:50 +00:00
|
|
|
echo "Updating github/fetchGithubRepoTest.sh"
|
|
|
|
./src/plugins/github/fetchGithubRepoTest.sh -u --no-build
|
2019-06-05 06:26:52 +00:00
|
|
|
|
2019-05-28 15:59:50 +00:00
|
|
|
echo "Updating Jest snapshots"
|
|
|
|
yarn unit -u
|