Details
- Reviewers
fatherbushido - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP19686: Add a test for the Upgrade Component, focusing on tech modifications.
Run the test. It should pass without error.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- upgradeTest
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 1803 Build 2855: Vulcan Build Jenkins Build 2854: arc lint + arc unit
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1252/ for more details.
(That test indeed doesn't fit in any other file. I don't know what's our policy about that.
Even if I tend to prefer to test things individually, that one makes sense as it shows a bug we encountered.)
Some quick inline remarks.
Finally, after my inline comments, you can just makes that unit tests for ugrade component alone.
You can even mock TechnologyManager (mock its ApplyModification functions) and add that mock at L128.
binaries/data/mods/public/simulation/components/tests/test_UpgradeModification.js | ||
---|---|---|
28 | imo mock that | |
29 | imo mock that | |
80 | so just mock here | |
85 | mock that too | |
95 | all that part would be away |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1329/ for more details.
Build is green
Executing section Default... Executing section Source... Executing section JS... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/22/ for more details.
Build is green
Executing section Default... Executing section Source... Executing section JS... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/25/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1333/ for more details.
I don't want to be annoying but perhaps you can look the comments I just add.
(You can perhaps also rename the file in test_Upgrade.js (even if we don't test all that component) - no clue about that. I will agree with your choice.)
Also nothing important but you can remove the () for single argument in arrow function if you want.
binaries/data/mods/public/simulation/components/tests/test_UpgradeModification.js | ||
---|---|---|
53 | I like! | |
77 | so you could nuke all that | |
86 | And perhaps we could so get rid of that. | |
155 | I would just add a mock for the "ApplyModifications" method here (so no need to boolean...) |
Remove unnecessary code.
Also add comments mentioning where each of the Mocked components' functions are used.
Hopefully the additional line comments help make it easier to tell what's used where.
[...] you can remove the () for single argument in arrow function if you want.
Forgot to do that this time round. I'll do it for the next diff.
Build is green
Executing section Default... Executing section Source... Executing section JS... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/37/ for more details.
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1346/ for more details.
Last comments, nothing really mandatory.
Ah yes I read to quickly to see the whole test, indeed we need the template mod. Now test is imo more isolated and test that whole past issue.
Don't know about the name of the file.
Some could say there are two many comments, but it's a matter of style and I m fine with that ;-)
Remains that partenthesis that you can remove, that newline and perhaps the missing spaces in objects in the TS_ASSERT things.
binaries/data/mods/public/simulation/components/tests/test_UpgradeModification.js | ||
---|---|---|
113 | ok you did the choice to do that and then call cmpPlayer.GetPlayerID() on what follow | |
114 | no need I think | |
126 | perhaps extra newline |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1362/ for more details.
Build is green
Executing section Default... Executing section Source... Executing section JS... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/49/ for more details.
Don't forget
svn propset svn:eol-style native binaries/data/mods/public/simulation/components/tests/test_UpgradeModification.js
before commiting