Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(web): enable testing against legacy devices via BrowserStack #11845

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
d970e0b
chore(web): install dev-deps @web/dev-server-legacy, @web/test-runner…
jahorton Jun 25, 2024
41f4aef
chore(web): restore keyboard-load testing via BrowserStack
jahorton Jun 25, 2024
665cca4
change(web): use function to apply browserstack-specific settings to …
jahorton Jun 25, 2024
4e2b6a1
chore(web): adds configs in other browser-based testing sections
jahorton Jun 25, 2024
018fd4f
chore(web): remove old karma-oriented config
jahorton Jun 25, 2024
b8950fd
chore(web): adds --remote option to web build/test scripts that can r…
jahorton Aug 12, 2024
a5c1766
chore(web): cntd build-script integration
jahorton Aug 13, 2024
77d075a
feat(web): restore test-timeout scaling for remote testing
jahorton Aug 13, 2024
f45d663
fix(web): patches up ci.sh
jahorton Aug 13, 2024
5b9a3f5
chore(web): Merge branch 'master' into chore/web/restore-legacy-auto-…
jahorton Aug 15, 2024
066cc40
Merge branch 'master' into chore/web/restore-legacy-auto-testing
jahorton Aug 15, 2024
a68e6fb
chore(web): Merge branch 'master' into chore/web/restore-legacy-auto-…
jahorton Aug 21, 2024
dd1aef3
chore(web): Merge remote-tracking branch 'origin/chore/web/restore-le…
jahorton Aug 21, 2024
72e4265
chore(web): test library dev-dependency -> web/package.json
jahorton Aug 21, 2024
4e79184
chore(web): move new files to new post-reorg location
jahorton Aug 21, 2024
e8bbf67
chore(web): remove no-longer-needed new file
jahorton Aug 21, 2024
a59b9ee
chore(web): update package-lock.json post-merge
jahorton Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion common/predictive-text/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ builder_describe "Builds the lm-layer module" \
"configure" \
"build" \
"test" \
"--ci Sets $(builder_term test) action to use CI-based test configurations & reporting"
"--ci Sets $(builder_term test) action to use CI-based test configurations & reporting" \
"--remote Sets $(builder_term test) action to use a BrowserStack-based testing configuration"

builder_describe_outputs \
configure /node_modules \
Expand Down Expand Up @@ -59,6 +60,8 @@ function do_test() {
local TEST_OPTIONS=
if builder_has_option --ci; then
TEST_OPTIONS=--ci
elif builder_has_option --remote; then
TEST_OPTIONS=--remote
fi

# We'll test the included libraries here for now. At some point, we may wish
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import standardConfig from './web-test-runner.config.mjs';
import { buildLegacyTestingConfig } from '@keymanapp/common-test-resources/wtr-browserstack-config.mjs';

const config = buildLegacyTestingConfig(standardConfig, '@keymanapp/lexical-model-layer');
export default config;
12 changes: 10 additions & 2 deletions common/predictive-text/unit_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ builder_describe "Runs all tests for the language-modeling / predictive-text lay
":libraries Runs unit tests for in-repo libraries used by this module"\
":headless Runs this module's headless user tests" \
":browser Runs this module's browser-based user tests" \
"--ci Uses CI-based test configurations & emits CI-friendly test reports"
"--ci Uses CI-based test configurations & emits CI-friendly test reports" \
"--remote Uses a BrowserStack-based test configuration for legacy devices"

# TODO: consider dependencies? ideally this will be test.inc.sh?

Expand Down Expand Up @@ -58,9 +59,14 @@ if builder_start_action test:libraries; then
popd

pushd "$KEYMAN_ROOT/common/web/lm-worker"
if builder_has_option --remote; then
WORKER_TEST_OPTS="$TEST_OPTS --remote"
else
WORKER_TEST_OPTS="$TEST_OPTS"
fi
echo
echo "### Running ${BUILDER_TERM_START}common/web/lm-worker${BUILDER_TERM_END} tests"
./build.sh test $TEST_OPTS
./build.sh test $WORKER_TEST_OPTS
popd

builder_finish_action success test:libraries
Expand Down Expand Up @@ -111,6 +117,8 @@ if builder_start_action test:browser; then

if builder_has_option --ci; then
WTR_CONFIG=.CI
elif builder_has_option --remote; then
WTR_CONFIG=.remote
fi

if builder_has_option --debug; then
Expand Down
159 changes: 0 additions & 159 deletions common/test/resources/karma-browserstack-config.cjs

This file was deleted.

9 changes: 9 additions & 0 deletions common/test/resources/test-runner-TC-reporter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,18 @@ export default function teamcityReporter({ name="Web Test Runner JavaScript test

for(const sessionName of sessionFailureMap.keys()) {
const sessionTestData = testDefMap.get(sessionName);
const session = args.sessions.find((entry) => buildSessionName(entry) == sessionName);

logger.log('');
logger.log(`Failure data for '${sessionName}'`);

if(session.errors) {
for(let error of session.errors) {
// "Browser tests did not start after xxxx ms..."" errors appear here.
logger.error(` ${error.message}`);
}
}

for(const sessionFile of sessionFailureMap.get(sessionName)) {
const testFile = sessionFile.testFile;
const fileTestData = sessionTestData.get(testFile);
Expand Down
9 changes: 9 additions & 0 deletions common/test/resources/test-timeouts-remote.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as baseTimeouts from './test-timeouts.mjs';

// General pattern, in case more are defined.
const scaledTimeouts = {
...baseTimeouts
};
Object.keys(baseTimeouts).forEach((key) => scaledTimeouts[key] *= 10);

export const DEFAULT_BROWSER_TIMEOUT = scaledTimeouts.DEFAULT_BROWSER_TIMEOUT; //ms
Loading
Loading