Skip to content

Commit

Permalink
[MSCMPUB-69] ITs do not properly check for existence of svn/svnadmin/…
Browse files Browse the repository at this point in the history
…CreateSymbolicLink command/function
  • Loading branch information
michael-o committed Jun 16, 2024
1 parent 1b4a3ed commit 12afe10
Show file tree
Hide file tree
Showing 8 changed files with 190 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/it/issue-mscmpub-50/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@
# under the License.

invoker.goals = site scm-publish:publish-scm

# Windows doesn't have svn and svnadmin executables
invoker.os.family = !windows
40 changes: 40 additions & 0 deletions src/it/issue-mscmpub-50/selector.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.nio.file.Files
import java.nio.file.Path

try {
def proc = "svnadmin".execute()
proc.consumeProcessOutput()
proc.waitFor()

def proc2 = "svn".execute()
proc2.consumeProcessOutput()
proc2.waitFor()

def pom = basedir.toPath().resolve("pom.xml")
def linkedPom = basedir.toPath().resolve("linked-pom.xml")
Files.deleteIfExists(linkedPom)
Files.createSymbolicLink(linkedPom, pom)
} catch (IOException e) {
return false
}

return true
3 changes: 0 additions & 3 deletions src/it/publish-scm-skip/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@
# under the License.

invoker.goals = site scm-publish:publish-scm

# Windows doesn't have svn and svnadmin executables
invoker.os.family = !windows
40 changes: 40 additions & 0 deletions src/it/publish-scm-skip/selector.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.nio.file.Files
import java.nio.file.Path

try {
def proc = "svnadmin".execute()
proc.consumeProcessOutput()
proc.waitFor()

def proc2 = "svn".execute()
proc2.consumeProcessOutput()
proc2.waitFor()

def pom = basedir.toPath().resolve("pom.xml")
def linkedPom = basedir.toPath().resolve("linked-pom.xml")
Files.deleteIfExists(linkedPom)
Files.createSymbolicLink(linkedPom, pom)
} catch (IOException e) {
return false
}

return true
32 changes: 32 additions & 0 deletions src/it/publish-scm-staged/selector.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

try {
def proc = "svnadmin".execute()
proc.consumeProcessOutput()
proc.waitFor()

def proc2 = "svn".execute()
proc2.consumeProcessOutput()
proc2.waitFor()
} catch (IOException e) {
return false
}

return true
3 changes: 0 additions & 3 deletions src/it/publish-scm/invoker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,3 @@
# under the License.

invoker.goals = site scm-publish:publish-scm

# Windows doesn't have svn and svnadmin executables
invoker.os.family = !windows
46 changes: 46 additions & 0 deletions src/it/publish-scm/selector.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import java.nio.file.Files
import java.nio.file.Path
import java.util.Locale

try {
def proc = "svnadmin".execute()
proc.consumeProcessOutput()
proc.waitFor()

def proc2 = "svn".execute()
proc2.consumeProcessOutput()
proc2.waitFor()

def pom = basedir.toPath().resolve("pom.xml")
def linkedPom = basedir.toPath().resolve("linked-pom.xml")
Files.deleteIfExists(linkedPom)
Files.createSymbolicLink(linkedPom, pom)
} catch (IOException e) {
return false
}

// Because of a bug in Subversion on Windows
if (System.properties['os.name'].toLowerCase(Locale.ROOT).contains('windows')) {
return false
}

return true
32 changes: 32 additions & 0 deletions src/it/site-deploy/selector.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

try {
def proc = "svnadmin".execute()
proc.consumeProcessOutput()
proc.waitFor()

def proc2 = "svn".execute()
proc2.consumeProcessOutput()
proc2.waitFor()
} catch (IOException e) {
return false
}

return true

0 comments on commit 12afe10

Please sign in to comment.