Saylua-Archive / SayluaLegacy

Browser Game In Development
saylua.com
GNU Affero General Public License v3.0
2 stars 0 forks source link

Basic Unit Tests #12

Closed NoiSek closed 7 years ago

NoiSek commented 7 years ago

The important part here is making sure these tests are automatically run on commits to master and reported.

NoiSek commented 7 years ago

I don't think we should bother covering any of our Python until we're done prototyping, writing thorough tests is way too exhausting for the state of flux that the backend API is currently in.

Will continue with Javascript tests, however. Have attached some JS prerequisites to this task.

Might also be good to look into Coveralls so we can track our test coverage.

Thoughts on deferring pytests / adding Coveralls?

tiffz commented 7 years ago

Sounds good to me. Coverage checking is good.

tiffz commented 7 years ago

One thought I did have was that maybe we could write tests for Python as things got rewritten in SQLAlchemy?

I guess this depends on other factors too. ie: is upgrading Flask versions blocking/should we switch to Python 3/if we did switch to Python 3 would that be blocking.

NoiSek commented 7 years ago

Never responded to the above but no I don't think we're blocked from upgrading Flask / Python by anything except AppEngine itself.

Pillow / SQLAlchemy / Flask are all well supported up to 3.6 at this point.

As far as progressive unit tests with the SQLAchemy migrations, yeah, that'd probably be the usual approach. I'm just not sure if our rate of change will outpace the rate at which we can write comprehensive unit tests (i.e. more than 'does it run without crashing'), and unit tests are not particularly helpful to our productivity this early on in development I think.

The setup should be done regardless, I'm just not particularly keen on sitting down and actually getting it to 100% coverage rather than putting that time into code is all. Would like to think that we write decent enough Python between the three of us that a pre-push linter should suffice for now.

tiffz commented 7 years ago

That's fine, I don't think aiming for 100% or even just high coverage makes sense at this point. I think it would help our productivity at this stage even, though, to have some trivial unit tests. ie: ones that make sure none of the stable endpoints broke from a change. There have already been quite a few things broken from unrelated changes that went unnoticed for a long time. Stick with only testing the stuff we're like 95% sure is here to stay. Such as having the login page actually render.

NoiSek commented 7 years ago

++

NoiSek commented 7 years ago

Split into more isolated pieces.