Skip to content

Commit bd7dcac

Browse files
authored
Merge pull request #1 from CodeSmithDSMLProjects/davidkim
Updates
2 parents 80f4dc6 + 52e6aa8 commit bd7dcac

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

.github/workflows/deploy-benchmark-prod.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ on:
77
paths:
88
- "e2e/benchmarks/**"
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
deploy_live_website:
15+
permissions:
16+
pull-requests: write # for FirebaseExtended/action-hosting-deploy to comment on PRs
1217
runs-on: ubuntu-latest
1318
steps:
1419
- uses: actions/checkout@v2

tfjs-layers/src/BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ ts_library(
7878

7979
ts_library(
8080
name = "tfjs-layers_test_lib",
81-
# disable testonly for the issue in the nodejs build target.
82-
# https://github.com/bazelbuild/rules_nodejs/pull/2984
83-
#testonly = True,
81+
testonly = True,
8482
srcs = glob(TEST_SRCS) + [":tests"],
8583
module_name = "@tensorflow/tfjs-layers/dist",
8684
deps = [

tfjs-layers/src/setup_tests.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ import '@tensorflow/tfjs-backend-webgl';
2828
// tslint:disable-next-line: no-imports-from-dist
2929
import {parseTestEnvFromKarmaFlags, registerTestEnv, setTestEnvs, TEST_ENVS} from '@tensorflow/tfjs-core/dist/jasmine_util';
3030

31-
registerTestEnv({
31+
// Register test environments.
32+
const webgl1TestEnv = {
3233
name: 'webgl1',
3334
backendName: 'webgl',
3435
flags: {
@@ -37,15 +38,31 @@ registerTestEnv({
3738
'WEBGL_SIZE_UPLOAD_UNIFORM': 0
3839
},
3940
isDataSync: true
41+
};
42+
registerTestEnv(webgl1TestEnv);
43+
registerTestEnv({name: 'cpu', backendName: 'cpu'});
44+
registerTestEnv({
45+
name: 'webgl2',
46+
backendName: 'webgl',
47+
flags: {
48+
'WEBGL_VERSION': 2,
49+
'WEBGL_CPU_FORWARD': false,
50+
'WEBGL_SIZE_UPLOAD_UNIFORM': 0
51+
}
4052
});
4153

4254
// Allow flags to override test envs
4355
// tslint:disable-next-line:no-any
4456
declare let __karma__: any;
4557
if (typeof __karma__ !== 'undefined') {
4658
const testEnv = parseTestEnvFromKarmaFlags(__karma__.config.args, TEST_ENVS);
59+
4760
if (testEnv != null) {
4861
setTestEnvs([testEnv]);
62+
} else {
63+
// Exclude webgl1 unless it is specifically requested because it causes
64+
// test flakiness when switching between webgl1 and webgl2.
65+
setTestEnvs(TEST_ENVS.filter(env => env !== webgl1TestEnv));
4966
}
5067
}
5168

tfjs-layers/src/utils/test_utils.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,10 @@
1414

1515
import {memory, Tensor, test_util, util} from '@tensorflow/tfjs-core';
1616
// tslint:disable-next-line: no-imports-from-dist
17-
import {ALL_ENVS, describeWithFlags, registerTestEnv} from '@tensorflow/tfjs-core/dist/jasmine_util';
17+
import {ALL_ENVS, describeWithFlags} from '@tensorflow/tfjs-core/dist/jasmine_util';
1818

1919
import {ValueError} from '../errors';
2020

21-
// Register backends.
22-
registerTestEnv({name: 'cpu', backendName: 'cpu'});
23-
registerTestEnv({
24-
name: 'webgl2',
25-
backendName: 'webgl',
26-
flags: {
27-
'WEBGL_VERSION': 2,
28-
'WEBGL_CPU_FORWARD': false,
29-
'WEBGL_SIZE_UPLOAD_UNIFORM': 0
30-
}
31-
});
32-
3321
/**
3422
* Expect values are close between a Tensor or number array.
3523
* @param actual

0 commit comments

Comments
 (0)