forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bash-completion goal when run from sdist/pex. Also add tests, and…
… beef up ci.sh & release.sh. When running the latest pants from a PEX inside of Twitter, I noticed that the new `bash-completion` goal didn't work. This sort of error is actually hard to detect, so I added some more smoke tests to `ci.sh`. On my way, I also beefed up `release.sh`. Reviewed at https://rbcommons.com/s/twitter/r/2403/
- Loading branch information
Showing
7 changed files
with
106 additions
and
16 deletions.
There are no files selected for viewing
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
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
24 changes: 24 additions & 0 deletions
24
tests/python/pants_test/backend/core/tasks/test_bash_completion.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,24 @@ | ||
# coding=utf-8 | ||
# Copyright 2015 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) | ||
|
||
from pants.backend.core.tasks.bash_completion import BashCompletionTask | ||
from pants_test.tasks.task_test_base import ConsoleTaskTestBase | ||
|
||
|
||
class MockedBashCompletionTask(BashCompletionTask): | ||
"""A version of the BashCompletionTask, with the goal/help parsing mocked out.""" | ||
def parse_all_tasks_and_help(self, _): | ||
return set(), '', set() | ||
|
||
|
||
class BashCompletionTest(ConsoleTaskTestBase): | ||
@classmethod | ||
def task_type(cls): | ||
return MockedBashCompletionTask | ||
|
||
def test_bash_completion_loads_template(self): | ||
self.assert_console_output_contains("# Pants Autocompletion Support") |
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