• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 5601 / 3
0%
main: 93%

Build:
Build:
LAST BUILD BRANCH: upgrade_pex
DEFAULT BRANCH: main
Ran 11 Jul 2015 02:56PM UTC
Files 335
Run time 17s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Jul 2015 02:56PM UTC coverage: 66.53%. Remained the same
CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'"

push

travis-ci

John Sirois
Fix test_execute_fail.

This fixes test_execute, but not the underlying global state used in
DummyTask.  Its that state, that appears to have supported a successful
run under certain sharding / test method ordering, although I was not
able to positively identify a sequence of calls that would lead to
test_execute ever passing.

In particular, it had 2 local errors that look systemic:

1. The raises regex did not escape the parens.
   Before this fix, the regex only could match 'Failed to generate
   targets' - with 's' being in an unused capture group.
2. The assertRaisesRegexp callable argument was not a callable.
   The _result_ of task.execute() was passed instead of the task.execute
   method.

These system errors were in addition to the lack of setup of the global
strategy explicitly.  That strategy is needed to ensure DummyGen's
execute_codegen is called leading to the raise.  Using the isolated
strategy (which was the default) with no targets short circuits the
execute_codegen call, failing to ever engage the `should_fail` forced
raise.

Testing Done:
Before:
```console
$ ./pants test tests/python/pants_test/backend/codegen/tasks:simple_codegen_task
...
tests/python/pants_test/backend/codegen/tasks/test_simple_codegen_task.py .....F.

==================== FAILURES ====================
____ SimpleCodegenTaskTest.test_execute_fail _____

self = <test_simple_codegen_task.SimpleCodegenTaskTest testMethod=test_execute_fail>

   def test_execute_fail(self):
     task = self._create_dummy_task()
     task.should_fail = True
>     self.assertRaisesRegexp(TaskError, 'Failed to generate target(s)', task.execute())
E     TypeError: 'NoneType' object is not callable

tests/python/pants_test/backend/codegen/tasks/test_simple_codegen_task.py:126: TypeError
...
```

After - success.

CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/70515314

Bugs closed: 1794

Reviewed at https://rbcommons.com/s/twitter/r/2461/

13306 of 20000 relevant lines covered (66.53%)

0.67 hits per line

Source Files on job 5601.3 (CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'")
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 5601
  • Travis Job 5601.3
  • f17710cf on github
  • Prev Job for CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'" on master (#5598.3)
  • Next Job for CI_FLAGS="-fkmsrcn -u 1/2 'Unit tests for pants and pants-plugins - shard 2'" on master (#5602.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc