Bug 155781 - Add unit tests for test-group.js
Summary: Add unit tests for test-group.js
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Perf Dashboard (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-22 18:40 PDT by Ryosuke Niwa
Modified: 2016-03-23 14:55 PDT (History)
7 users (show)

See Also:


Attachments
Adds tests (19.96 KB, patch)
2016-03-22 18:43 PDT, Ryosuke Niwa
joepeck: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2016-03-22 18:40:17 PDT
Add tests for TestGroup objects so that we can catch regressions like the ones fixed in r198503 in the future.
Comment 1 Ryosuke Niwa 2016-03-22 18:43:42 PDT
Created attachment 274721 [details]
Adds tests
Comment 2 Joseph Pecoraro 2016-03-23 14:36:17 PDT
Comment on attachment 274721 [details]
Adds tests

View in context: https://bugs.webkit.org/attachment.cgi?id=274721&action=review

r=me

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:130
> +        it('should create build reuqests for each group', function () {

Typo: "reuqests" => "requests"

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:213
> +        it('should return true if all build requests have been cancled', function () {

Typo: "cancled" => "canceled"

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:238
> +            assert.ok(!testGroupWithStatusList(['completed', 'cancled', 'completed', 'running']).hasFinished());

Typo: "cancled"

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:251
> +        it('should return true if all build requests have been cancled', function () {

Typo: "cancled"

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:277
> +        it('should return false if some build requests have completed', function () {
> +            assert.ok(testGroupWithStatusList(['completed', 'pending', 'pending', 'pending']).hasStarted());
> +        });
> +
> +        it('should return false if some build requests are scheduled', function () {
> +            assert.ok(testGroupWithStatusList(['scheduled', 'pending', 'pending', 'pending']).hasStarted());
> +        });
> +
> +        it('should return false if some build requests are running', function () {
> +            assert.ok(testGroupWithStatusList(['running', 'pending', 'pending', 'pending']).hasStarted());
> +        });

These all assert "true" but the should sentence says false.

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:289
> +        it('should return false if all build requests have been cancled', function () {

Typo: "cancled"

> Websites/perf.webkit.org/unit-tests/test-groups-tests.js:306
> +            assert.ok(testGroupWithStatusList(['completed', 'failed', 'cancled', 'pending']).hasPending());

Typo: "cancled"
Comment 3 Ryosuke Niwa 2016-03-23 14:53:03 PDT
Thanks for the review! Will fix those before landing.
Comment 4 Ryosuke Niwa 2016-03-23 14:55:54 PDT
Committed r198598: <http://trac.webkit.org/changeset/198598>