Fix up CircleCI/TravisCI tests and webapi token generation.

Review Request #9467 — Created Jan. 1, 2018 and submitted

Information

rbintegrations
release-0.5.x
a6122bc...

Reviewers

A few API changes in djblets and kgb caused a couple breakages in the
rbintegrations tests. This change fixes those up.

In review, it was also pointed out that assertions inside callbacks that
come from something using SignalHook won't be recorded properly,
because the extension sandboxing swallows them. I've moved code around
so that we do all the assertions inside the test case code instead of in
deep callbacks.

Ran unit tests.

Description From Last Updated

F841 local variable 'url' is assigned to but never used

reviewbotreviewbot

E501 line too long (80 > 79 characters)

reviewbotreviewbot

These will stick around for every test. We should store it in a local dictionary variable. Same with the others.

chipx86chipx86
MU
  1. 
      
  2. rbintegrations/circleci/tests.py (Diff revision 1)
     
     
     

    The asserts inside a method swapped by kgb don't work when called from SignalHook callbacks - the default sandbox_errors=True catches all exceptions. This is why the unexpected keyword argument error for _urlopen didn't cause the tests to fail before, and any failed asserts inside the method won't be seen either.

    Is there some way to possibly use kgb to change the default for sandbox_errors in unit tests? Or perhaps another more general solution?

    1. Hmm, that's a good point. I think perhaps what we need to do is record the failure inside the callback and then assert outside of it.

  3. 
      
david
Review request changed

Summary:

-Fix up CircleCI tests and webapi token generation.
+Fix up CircleCI/TravisCI tests and webapi token generation.

Description:

   

A few API changes in djblets and kgb caused a couple breakages in the

    rbintegrations tests. This change fixes those up.

  +
  +

In review, it was also pointed out that assertions inside callbacks that

  + come from something using SignalHook won't be recorded properly,
  + because the extension sandboxing swallows them. I've moved code around
  + so that we do all the assertions inside the test case code instead of in
  + deep callbacks.

Commit:

-2912eb6f856b53b7afe876dede0367ae66b7bbb9
+3ea03085ccf5f301e3d8282574d8ab9ecb6cd25c

Diff:

Revision 2 (+82 -62)

Show changes

Checks run (1 failed, 1 succeeded)

flake8 failed.
JSHint passed.

flake8

david
chipx86
  1. 
      
  2. rbintegrations/circleci/tests.py (Diff revision 3)
     
     
     
    Show all issues

    These will stick around for every test. We should store it in a local dictionary variable.

    Same with the others.

  3. 
      
david
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.5.x (c03045a)
Loading...