Run acceptance tests with different configs using @Parameterized
This is a simpler approach as it doesn't require generating extra test targets for Buck, nor rebuilding test jars to get everything working in Eclipse. There are enough tests running at any given time with Buck that having each acceptance test take twice as long should maintain adequate parallelism. Change-Id: I109acaf6b957e8f9dd621e98abe46a75f78cdc32
This commit is contained in:
@@ -14,40 +14,16 @@
|
||||
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.io.Resources;
|
||||
|
||||
import org.eclipse.jgit.errors.ConfigInvalidException;
|
||||
import org.eclipse.jgit.lib.Config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
class ConfigAnnotationParser {
|
||||
private static final String CONFIG_PKG =
|
||||
"com.google.gerrit.acceptance.config.";
|
||||
private static final String CONFIG_DIR = "/" + CONFIG_PKG.replace('.', '/');
|
||||
private static Splitter splitter = Splitter.on(".").trimResults();
|
||||
|
||||
static Config parseFromSystemProperty()
|
||||
throws ConfigInvalidException, IOException {
|
||||
Config cfg = new Config();
|
||||
String name = System.getProperty(CONFIG_PKG + "BaseConfig");
|
||||
if (!Strings.isNullOrEmpty(name)) {
|
||||
String resource = CONFIG_DIR + name + ".config";
|
||||
URL url = checkNotNull(ConfigAnnotationParser.class.getResource(resource),
|
||||
"test config resource not found: %s", resource);
|
||||
cfg.fromText(Resources.toString(url, Charsets.UTF_8));
|
||||
}
|
||||
return cfg;
|
||||
}
|
||||
|
||||
static Config parse(Config base, GerritConfigs annotation) {
|
||||
if (annotation == null) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user