Hey, y'all! I am Peter, pharpend in the channel. For a while, I've been spending some spare time working on GH-144: <https://github.com/snowdriftcoop/snowdrift/issues/144>. I thought it was a trivial issue that would take 20 minutes to fix, but it turns out to be symptomatic of a much larger problem.
There are two sides to it: 1. Logged-in users can create a new user in /u/new. 2. Logged-in users can view /auth/login without trouble. The fix to the first problem was pretty easy: put a clause in UserCreateR to 400 if the user is already logged in, as seen here: <https://bpaste.net/show/c2188e926f94>. See <https://git.gnu.io/pharpend/snowdrift/network/gh-144-porcelain> for more details. The second turned out to be an issue with yesod-auth, which the Yesod people are now working on: <https://github.com/yesodweb/yesod/issues/1090>. The problem: fixing the first half caused half the tests to fail, mostly because they were structured poorly. Here, there's a seemingly innocuous test that dictates that users should be able to create a new user: <https://git.gnu.io/pharpend/snowdrift/blob/gh-144-porcelain/tests/UserTest.hs#L17> However, that test is incorrect, and by GH-144 should fail. I couldn't figure out a way to make it pass, so Bryan suggested I remove it. However, it turns out that other tests depend on that first test passing. Essentially, further tests log in as the users created during that test. This is bad, because each test should be independent: a test passing should not depend on other tests passing. So, we need to do one of three things: 1. Ignore GH-144 for the time being. 2. Figure out some hack so that the test in question passes. 3. Rewrite the test suite so that silly things like that don't happen. I think (3) would be the best option, but it would require a lot of dedicated effort. I know that rewriting the test suite is a fairly high-priority item, and probably a necessity before we reach a full release. I would like everyone's thoughts on the matter before I go raining on everyone's parade. Peter
pgpWKxxzb2kRk.pgp
Description: PGP signature
_______________________________________________ Dev mailing list [email protected] https://lists.snowdrift.coop/mailman/listinfo/dev
