Fix up CircleCI/TravisCI tests and webapi token generation.

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

david
rbintegrations
release-0.5.x
a6122bc...
rbintegrations

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.

  • 0
  • 0
  • 3
  • 0
  • 3
Description From Last Updated
  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)
     
     
     

    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...