gerrit/gerrit-acceptance-tests/tests.defs
Dave Borowitz 88da34f7fc Support acceptance tests running with different configs
Store a library of configs to be used as the base gerrit.config during
tests. Specify at a per-acceptance_tests-rule level which of these
configs to generate rules for, passing in the config file via a system
property in a new rule named based on the config file name.

Include two additional labels for each test, "acceptance_config" and
"config_<name>", for including and excluding specific configs or all
non-default configs.

This preserves the behavior of running a single test class per VM, at
the cost of making it harder to run tests with nonstandard configs
from Eclipse. For that, developers can create custom run
configurations with different VM args passing the appropriate -D.

Change-Id: If29bcba26ac271479a63da836008b0f6608a1b6c
2014-01-16 15:39:28 -08:00

37 lines
901 B
Plaintext

def acceptance_tests(
srcs,
deps = [],
configs = [],
vm_args = ['-Xmx256m']):
for j in srcs:
for config in [None] + configs:
name = j[:-len('.java')]
labels = [
'acceptance',
'slow',
]
curr_vm_args = list(vm_args)
if config:
curr_vm_args.append(
'-Dcom.google.gerrit.acceptance.config.BaseConfig=' + config)
name += '_' + config
labels.append('acceptance_config')
labels.append('config_' + config)
java_test(
name = name,
srcs = [j],
deps = deps + [
'//gerrit-acceptance-tests:configs',
'//gerrit-acceptance-tests:lib',
],
source_under_test = [
'//gerrit-httpd:httpd',
'//gerrit-sshd:sshd',
'//gerrit-server:server',
],
labels = labels,
vm_args = curr_vm_args,
)