Skip to content

Instantly share code, notes, and snippets.

@nitay

nitay/x.py Secret

Created May 18, 2016 20:01
Show Gist options
  • Save nitay/54417972b50419f0d525b7bc545ff323 to your computer and use it in GitHub Desktop.
Save nitay/54417972b50419f0d525b7bc545ff323 to your computer and use it in GitHub Desktop.
import pprint
from pants.backend.jvm.targets.java_tests import JavaTests
from pants.build_graph.build_file_aliases import BuildFileAliases
pp = pprint.PrettyPrinter(indent=4)
class AiqJavaTests(JavaTests):
def __init__(self, parse_context, **kwargs):
self.parse_context = parse_context
self.kwargs = kwargs
def __call__(self, **kwargs):
base_deps = [
'3rdparty/com/h2database:h2', # H2 database for sorm test DB
'3rdparty/ch/qos/logback:logback-classic', # runtime logback implementation
'3rdparty/org/slf4j:redirects', # redirect all logging to slf4j-api
'3rdparty/org/specs2', # specs2 library
'config/src/test/resources' # test configs like logback
]
kwargs['dependencies'] = base_deps + kwargs.get('dependencies', [])
self.kwargs.update(**kwargs)
self.parse_context.create_object('java_tests', self.kwargs)
def build_file_aliases():
return BuildFileAliases(
targets={
'aiq_junit_tests': AiqJavaTests
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment