-
-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cycle detection is tested in `test_sort_targets.py`, but having a cycle existing directly in the repo breaks implementations of graph parsing that validate cycles early. While `testprojects` is explicitly for "broken" code, keeping it `./pants list`able seems important for maintaining it. - Move cycle detection integration test into `test_build_graph_integration` with mangled BUILD file names. Testing Done: https://travis-ci.org/pantsbuild/pants/builds/118118736 Bugs closed: 3058, 3081 Reviewed at https://rbcommons.com/s/twitter/r/3600/
- Loading branch information
Showing
8 changed files
with
41 additions
and
15 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tests/python/pants_test/build_graph/test_build_graph_integration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# coding=utf-8 | ||
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, | ||
unicode_literals, with_statement) | ||
|
||
import os | ||
|
||
from pants_test.pants_run_integration_test import PantsRunIntegrationTest | ||
|
||
|
||
class BuildGraphIntegrationTest(PantsRunIntegrationTest): | ||
|
||
def test_cycle(self): | ||
prefix = 'testprojects/src/java/org/pantsbuild/testproject' | ||
with self.file_renamed(os.path.join(prefix, 'cycle1'), 'TEST_BUILD', 'BUILD'): | ||
with self.file_renamed(os.path.join(prefix, 'cycle2'), 'TEST_BUILD', 'BUILD'): | ||
pants_run = self.run_pants(['compile', os.path.join(prefix, 'cycle1')]) | ||
self.assert_failure(pants_run) | ||
self.assertIn('Cycle detected', pants_run.stderr_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters