Page MenuHomeWildfire Games

Fix Builder test failure following r19488 and r20521
ClosedPublic

Authored by elexis on Nov 25 2017, 8:26 PM.

Details

Summary

The first commit is broken because a playerID is different from a playerEntityID.
The second one because it didn't update the tests.

Test Plan

run the tests, notice that the same stuff is covered

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Nov 25 2017, 8:26 PM
Vulcan added a subscriber: Vulcan.Nov 25 2017, 9:05 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests).
In TestComponentScripts::test_scripts:
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:19:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== []
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:35:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_barracks", "structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:41:1
Expected equal, got [] !== ["structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:53:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_barracks", "structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:61:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_civil_centre"]
..................................................................................................................................................................................................................................................................................................................
Failed 1 and Skipped 0 of 308 tests
Success rate: 99%
Running debug tests...
Running cxxtest tests (308 tests).
In TestComponentScripts::test_scripts:
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:19:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== []
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:35:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_barracks", "structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:41:1
Expected equal, got [] !== ["structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:53:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_barracks", "structures/iber_civil_centre"]
../../../source/test_setup.cpp:134: Error: Test failed: Stack trace:
@simulation/components/tests/test_Builder.js:61:1
Expected equal, got ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] !== ["structures/iber_civil_centre"]
..................................................................................................................................................................................................................................................................................................................
Failed 1 and Skipped 0 of 308 tests
Success rate: 99%
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
bb accepted this revision.Nov 25 2017, 9:19 PM
bb added a subscriber: Itms.

Some orders can be done when committing.

hmmm vulcan still yells @Itms ?

binaries/data/mods/public/simulation/components/tests/test_Builder.js
19 ↗(On Diff #4376)

not the same stuff exactly, but all the current correct indeed

48–58 ↗(On Diff #4376)

the order here should be consistent with the first mock (as the first has the order defined in player.js)

This revision is now accepted and ready to land.Nov 25 2017, 9:19 PM
mimo added a subscriber: mimo.Nov 26 2017, 12:09 AM

Thanks for the fix of the tests

Stan added a comment.Nov 26 2017, 1:05 AM

As I can't build the test executable I'm gonna pass for this one. What I read looks good at first sight. The introduction of that variable is good and nice catch for those unnecessary parentheses.

Itms accepted this revision.Nov 26 2017, 11:47 AM
In D1067#42271, @bb wrote:

hmmm vulcan still yells @Itms ?

Yes, this is because Vulcan tests patches on top of the last successfully built commit. In our case this is rP20520. Applying the patch here creates tests that do not match the changes added in rP20521.
The situation is not supposed to happen since D1065 didn't pass the tests, and I need to figure out why Jenkins didn't mark the build as failed for that differential.

Green light for committing this fix, thanks for looking into it!

Thanks for the reviews and comments.

binaries/data/mods/public/simulation/components/tests/test_Builder.js
48–58 ↗(On Diff #4376)

Fixed. Made it alphabetic order everywhere which also minimizes the number of changed lines.

This revision was automatically updated to reflect the committed changes.