Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Jul 23, 2019
1 parent 52ad079 commit 05209c0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 72 deletions.
61 changes: 1 addition & 60 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,6 @@ pr:
- dco.txt

jobs:
- job: Build_Native_Linux
timeoutInMinutes: 180
pool:
vmImage: 'Ubuntu 16.04'

variables:
imageName: 'quarkus:$(build.buildId)'

steps:

- script: docker run --rm --publish 5432:5432 --name build-postgres -e POSTGRES_USER=hibernate_orm_test -e POSTGRES_PASSWORD=hibernate_orm_test -e POSTGRES_DB=hibernate_orm_test -d postgres:10.5
displayName: 'start postgres'

- script: docker run --rm --publish 8000:8000 --name build-dynamodb -d amazon/dynamodb-local:1.11.477
displayName: 'start dynamodb'

- task: Maven@3
displayName: 'Maven Build'
inputs:
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dnative-image.docker-build -Dtest-postgresql -Dtest-elasticsearch -Dtest-dynamodb -Ddynamodb-local.port=8000 -Dnative-image.xmx=6g -Dnative -Dno-format'

- job: Windows_Build
timeoutInMinutes: 60
Expand All @@ -59,42 +38,4 @@ jobs:
displayName: 'Maven Build'
inputs:
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format'

- job: Build_JDK11_Linux
timeoutInMinutes: 60
pool:
vmImage: 'Ubuntu 16.04'

variables:
imageName: 'quarkus-jdk11:$(build.buildId)'

steps:
- task: Maven@3
displayName: 'Maven Build'
inputs:
jdkVersionOption: '1.11'
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format'

- job: Run_TCKs
timeoutInMinutes: 45
pool:
vmImage: 'Ubuntu 16.04'

variables:
imageName: 'quarkus:$(build.buildId)'

steps:

- task: Maven@3
displayName: 'Maven Install'
inputs:
goals: 'install'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format -DskipTests -Dtcks'

- task: Maven@3
displayName: 'Maven Verify'
inputs:
goals: 'verify'
mavenPomFile: 'tcks/pom.xml'
options: '-B --settings azure-mvn-settings.xml -Dno-native -Dno-format -Dtest=CreateExtensionMojoTest -DfailIfNoTests=false'
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ static void transform(Collection<Transformation> edits, Path path, Supplier<Stri
}

final XPath xPath = XPathFactory.newInstance().newXPath();
final TransformationContext context = new TransformationContext(path, detectIndentation(document, xPath),
detectEol(src), xPath);
final String eol = detectEol(src);
final TransformationContext context = new TransformationContext(path, detectIndentation(document, xPath), eol,
xPath);
for (Transformation edit : edits) {
edit.perform(document, context);
}
Expand Down Expand Up @@ -240,16 +241,16 @@ public static Transformation addModule(String module) {
XPathConstants.NODE);
if (modules == null) {
final Node modulesIndent = document
.createTextNode(context.getEol() + context.getIndentationString());
.createTextNode("\n" + context.getIndentationString());
modules = document.createElement("modules");
modules.appendChild(document.createTextNode(context.getEol() + context.getIndentationString()));
modules.appendChild(document.createTextNode("\n" + context.getIndentationString()));

final Node build = (Node) context.getXPath().evaluate(anyNs("project", "build"), document,
XPathConstants.NODE);
if (build != null) {
Node ws = build.getPreviousSibling();
if (ws == null || ws.getNodeType() != Node.TEXT_NODE) {
ws = document.createTextNode(context.getEol() + context.getIndentationString());
ws = document.createTextNode("\n" + context.getIndentationString());
build.getParentNode().insertBefore(ws, build);
}
build.getParentNode().insertBefore(modulesIndent, ws);
Expand All @@ -265,7 +266,7 @@ public static Transformation addModule(String module) {
final int len = projectChildren.getLength();
Node ws = null;
if (len == 0 || (ws = projectChildren.item(len - 1)).getNodeType() != Node.TEXT_NODE) {
ws = document.createTextNode(context.getEol());
ws = document.createTextNode("\n");
project.appendChild(ws);
}
project.insertBefore(modulesIndent, ws);
Expand All @@ -274,15 +275,15 @@ public static Transformation addModule(String module) {
}

final Text indent = document.createTextNode(
context.getEol() + context.getIndentationString() + context.getIndentationString());
"\n" + context.getIndentationString() + context.getIndentationString());
final Node moduleNode = document.createElement("module");
moduleNode.appendChild(document.createTextNode(module));

final NodeList modulesChildren = modules.getChildNodes();
final int len = modulesChildren.getLength();
Node ws;
if (len == 0 || (ws = modulesChildren.item(len - 1)).getNodeType() != Node.TEXT_NODE) {
ws = document.createTextNode(context.getEol() + context.getIndentationString());
ws = document.createTextNode("\n" + context.getIndentationString());
modules.appendChild(ws);
}
modules.insertBefore(indent, ws);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CreateExtensionMojoTest {

static CreateExtensionMojo createMojo(String testProjectName) throws IllegalArgumentException,
IllegalAccessException, IOException, NoSuchFieldException, SecurityException {
final Path srcDir = Paths.get("target/test-classes/projects/" + testProjectName);
final Path srcDir = Paths.get("src/test/resources/projects/" + testProjectName);
/*
* We want to run on the same project multiple times with different args so let's create a copy with a random
* suffix
Expand All @@ -27,7 +27,8 @@ static CreateExtensionMojo createMojo(String testProjectName) throws IllegalArgu
.get("target/test-classes/projects/" + testProjectName + "-" + ((int) (Math.random() * 1000)));
Files.walk(srcDir).forEach(source -> {
try {
Files.copy(source, copyDir.resolve(srcDir.relativize(source)));
final Path dest = copyDir.resolve(srcDir.relativize(source));
Files.copy(source, dest);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand All @@ -51,7 +52,7 @@ void createExtensionUnderExistingPomMinimal() throws MojoExecutionException, Moj
mojo.assumeManaged = false;
mojo.execute();

assertTreesMatch(Paths.get("target/test-classes/expected/create-extension-pom-minimal"),
assertTreesMatch(Paths.get("src/test/resources/expected/create-extension-pom-minimal"),
mojo.basedir);
}

Expand All @@ -66,7 +67,7 @@ void createExtensionUnderExistingPomCustomGrandParent() throws MojoExecutionExce
mojo.execute();

assertTreesMatch(
Paths.get("target/test-classes/expected/create-extension-pom-with-grand-parent"),
Paths.get("src/test/resources/expected/create-extension-pom-with-grand-parent"),
mojo.basedir);
}

Expand Down

0 comments on commit 05209c0

Please sign in to comment.