Finish renaming BUILD_DIR; make tests more error-prone

I had forgotten that I needed to change the value of BUILD_DIR
in several different places.

Added comments warning future editors about this as well as filing
issue #5007 to track fixing this properly.

Despite being misconfigured and therefore failing, the typescript
and metadata test scripts were exiting with status 0, indicating
successful completion.  These have been fixed so they should fail
on any error, including misconfiguration.
This commit is contained in:
Christopher Allen
2021-07-09 14:06:59 +01:00
parent 1e4fa8005a
commit 9e72378b69
5 changed files with 32 additions and 13 deletions

View File

@@ -2,7 +2,6 @@
*_uncompressed*.js
gulpfile.js
/msg/*
/built/*
/dist/*
/core/utils/global.js
/tests/blocks/*

2
.gitignore vendored
View File

@@ -17,5 +17,5 @@ local_build/*compiler*.jar
local_build/local_*_compressed.js
chromedriver
typings/tmp/*
built/
build/
dist/

View File

@@ -12,6 +12,12 @@ var path = require('path');
// Paths are all relative to the repository root. Do not include
// trailing slash.
//
// TODO(#5007): If you modify these values, you must also modify the
// corresponding values in the following files:
//
// - tests/scripts/compile_typings.sh
// - tests/scripts/check_metadata.sh
module.exports = {
// Directory to write compiled output to.
BUILD_DIR: 'build',

View File

@@ -7,7 +7,10 @@
# Run this script to get the new values.
# Location of the pre-built compressed files.
readonly BUILD_DIR='built'
#
# (TODO(#5007): Should fetch this from scripts/gulpfiles/config.js
# instead of hardcoding it here.
readonly BUILD_DIR='build'
# These values should be updated with each release. (Note that the
# historic values are tab-delimited.)
@@ -65,6 +68,14 @@ readonly BOLD_GREEN='\033[1;32m'
readonly BOLD_RED='\033[1;31m'
readonly ANSI_RESET='\033[0m'
# Terminate immediately with non-zero status if any command exits
# with non-zero status, printing a nice message.
set -e
function fail {
echo -e "${BOLD_RED}Error while checking metadata.${ANSI_RESET}" >&2
}
trap fail ERR
# GZip them for additional size comparisons (keep originals, force
# overwite previously-gzipped copies).
echo "Zipping the compressed files"

View File

@@ -1,13 +1,24 @@
#!/bin/bash
# Location that npm run typings will write .d.ts files to.
readonly BUILD_DIR='built'
#
# (TODO(#5007): Should fetch this from scripts/gulpfiles/config.js
# instead of hardcoding it here.
readonly BUILD_DIR='build'
# ANSI colors
BOLD_GREEN='\033[1;32m'
BOLD_RED='\033[1;31m'
ANSI_RESET='\033[0m'
# Terminate immediately with non-zero status if any command exits
# with non-zero status, printing a nice message.
set -e
function fail {
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
}
trap fail ERR
# Generate Blockly typings.
echo "Generating Blockly typings"
npm run typings
@@ -18,12 +29,4 @@ echo "Compiling typings"
cd "${BUILD_DIR}"
../node_modules/.bin/tsc blockly.d.ts
if [ $? -eq 0 ]
then
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"
exit 0
else
echo -e "${BOLD_RED}Failed to compile TypeScript typings.${ANSI_RESET}" >&2
exit 1
fi
echo -e "${BOLD_GREEN}TypeScript typings compiled successfully.${ANSI_RESET}"