#2423 Multiple fixes for making the unit-tests pass
Merged by pingou. Opened by pingou.
fix_tests2  into  master

Download 2423.patch
no initial comment

What is the significance of "-+-"?

It's just a placeholder, the _cnt variable is in js and thus not accessible in the {{ url_for(..) }}, looking at this now I wonder if it's not worth reverting, the issue was with the lack of | safe

If you can revert then I'd prefer that. This seems very hacky, but it's okay if that's the way it has to be.

rebased

I adjusted the method get_wait_target as my changes weren't needed in fact, but I think I'll keep the change in the waiting template if that's ok with you.

Why is it that you're trying again on exception? If there's a specific reason, please add a comment in the code since this is strange behavior when unexplained. :stuck_out_tongue:

It could be cleaner if you left out count from the url_for function call, and then just appended the count argument with javascript afterwards.

So you could do something like this (untested):

var _url = '{{ url_for("wait_task", taskid=task.id, prev=prev) | safe }}';
// This line below is probably useless since you are always providing parameters `url_for` function, but I figured I'd add it.
_url += _url.contains('?') ? '&' : '?';
_url += 'count=' + _cnt;

@pingou a few small comments that are not blockers, but suggestions. +1 to merge.

Let's give it a try :)

I'll add a comment, somehow when running the tests, I was getting into errors which are likely due to a race-condition between files being created and files being removed. Not quite sure what's going on, but this fixes it despite being ugly :(

5 new commits added

  • Ugly but works, try to delete the folder twice
  • When forking a project, use the entire url instead of just a piece of it
  • Rework how the count variable is included in the URL called
  • Let's check if there are no results rather than restricting on one result
  • Flake8 fixes

@pingou feel free to merge this after you add the comment in tests/__init__.py.

5 new commits added

  • Ugly but works, try to delete the folder twice
  • When forking a project, use the entire url instead of just a piece of it
  • Rework how the count variable is included in the URL called
  • Let's check if there are no results rather than restricting on one result but be more flexible
  • Flake8 fixes

Reword to:
Sometimes there is a race condition that makes deleting the folder fail during the first attempt. So just try a second time if that's the case.

Small rewording request. +1

5 new commits added

  • Ugly but works, try to delete the folder twice
  • When forking a project, use the entire url instead of just a piece of it
  • Rework how the count variable is included in the URL called
  • Let's check if there are no results rather than restricting on one result but be more flexible
  • Flake8 fixes

reworded, rebased, merging :)

rebased

Pull-Request has been merged by pingou

Metadata