Skip to content

Commit

Permalink
Merge pull request #11723 from keymanapp/change/web/precompile-ts-tests
Browse files Browse the repository at this point in the history
change(web): precompile all TS-based tests
  • Loading branch information
mcdurdin authored Jun 7, 2024
2 parents 8d3c66b + 13476d4 commit 614f957
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 30 deletions.
10 changes: 8 additions & 2 deletions web/common.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ function prepare() {
# ```
function test-headless() {
TEST_FOLDER=$1
TEST_EXTENSIONS=${2:-}
TEST_BASE="${KEYMAN_ROOT}/web/src/test/auto/headless/"
TEST_EXTENSIONS=${2:-}
if [ ! -z "${2:-}" ]; then
TEST_BASE="${KEYMAN_ROOT}/web/build/test/headless/"

# Ensure the compiled tests are available.
tsc --project "${KEYMAN_ROOT}/web/src/test/auto/tsconfig.json"
fi

TEST_OPTS=
TEST_CD_REQD=false
Expand Down Expand Up @@ -135,5 +141,5 @@ function test-headless() {
function test-headless-typescript() {
# tests.js - ensure any plain-js files that exist as test resources, but not test defs,
# aren't treated by Mocha as tests.
test-headless "$1" "tests.ts"
test-headless "$1" "tests.js"
}
2 changes: 1 addition & 1 deletion web/src/engine/osk/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ do_build() {
builder_run_action configure do_configure
builder_run_action clean rm -rf "${KEYMAN_ROOT}/web/build/${SUBPROJECT_NAME}"
builder_run_action build do_build
builder_run_action test test-headless "${SUBPROJECT_NAME}"
builder_run_action test test-headless-typescript "${SUBPROJECT_NAME}"
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { assert } from 'chai';
import sinon from 'sinon';

import { ParsedLengthStyle } from 'keyman/engine/osk';

Expand Down
26 changes: 0 additions & 26 deletions web/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ builder_parse "$@"

# Browser-based tests: common configs & kill-switches

# DO_BROWSER_TEST_SUITE=true

# if [[ $VERSION_ENVIRONMENT == test ]]; then
# # Implied: CONFIG=CI.conf.js because `-CI` parameter is passed.
# #
# # If we are running a TeamCity test build, for now, only run BrowserStack
# # tests when on a PR branch with a title including "(web)" or with the label
# # test-browserstack. This is because the BrowserStack tests are currently
# # unreliable, and the false positive failures are masking actual failures.
# #
# # We do not run BrowserStack tests on master, beta, or stable-x.y test
# # builds.
# DO_BROWSER_TEST_SUITE=false
# if builder_pull_get_details; then
# if [[ $builder_pull_title =~ \(web\) ]] || builder_pull_has_label test-browserstack; then
# DO_BROWSER_TEST_SUITE=true
# fi
# fi
# fi

# if [[ $DO_BROWSER_TEST_SUITE == false ]]; then
# builder_warn "Skipping action test:engine - this CI build does not appear to be for a Web PR."
# builder_finish_action success test:engine
# exit 0
# fi

# Select the right CONFIG file.
WTR_CONFIG=
if builder_has_option --ci; then
Expand Down

0 comments on commit 614f957

Please sign in to comment.