Updating docs plugin and concourse scripts
Adding additional test output and updating the README on how to run every type of tests Adding missing active branch to dependabot config
This commit is contained in:
committed by
Gareth Clay
parent
fe80465f09
commit
8a4038450e
18
.github/dependabot.yml
vendored
18
.github/dependabot.yml
vendored
@@ -8,6 +8,22 @@ updates:
|
||||
open-pull-requests-limit: 15
|
||||
labels:
|
||||
- "dependency-upgrade"
|
||||
commit-message:
|
||||
prefix: "3.0.x"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
||||
|
||||
- package-ecosystem: gradle
|
||||
directory: "/"
|
||||
target-branch: "2.3.x"
|
||||
schedule:
|
||||
interval: daily
|
||||
open-pull-requests-limit: 15
|
||||
labels:
|
||||
- "dependency-upgrade"
|
||||
commit-message:
|
||||
prefix: "2.3.x"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
||||
@@ -20,6 +36,8 @@ updates:
|
||||
open-pull-requests-limit: 15
|
||||
labels:
|
||||
- "dependency-upgrade"
|
||||
commit-message:
|
||||
prefix: "2.2.x"
|
||||
ignore:
|
||||
- dependency-name: "*"
|
||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
||||
|
||||
24
README.adoc
24
README.adoc
@@ -12,14 +12,32 @@ A simple application that demonstrates the use of Spring CredHub is available in
|
||||
|
||||
== Building
|
||||
|
||||
=== Basic Compile and Test
|
||||
=== Basic Compile and Unit Tests
|
||||
|
||||
To build the source you will need to install JDK 17.
|
||||
|
||||
Spring CredHub uses Gradle for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing
|
||||
Spring CredHub uses Gradle for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
$ ./gradlew build
|
||||
./gradlew build
|
||||
----
|
||||
|
||||
=== Integration Tests
|
||||
|
||||
Spring CredHub integration tests need a CredHub server.
|
||||
|
||||
Refer to link:credhub-server/README.adoc[credhub-server] for information on how to start it up.
|
||||
|
||||
Once running they can be executed with:
|
||||
|
||||
[source,bash]
|
||||
----
|
||||
./gradlew :spring-credhub-integration-tests:test -PintegrationTests
|
||||
----
|
||||
[source,bash]
|
||||
----
|
||||
./gradlew :spring-credhub-reactive-integration-tests:test -PintegrationTests
|
||||
----
|
||||
|
||||
=== Working with the code
|
||||
|
||||
41
build.gradle
41
build.gradle
@@ -116,9 +116,46 @@ subprojects {
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
tasks.withType(Test).forEach { Test task ->
|
||||
task.with {
|
||||
// enable JUnit 5
|
||||
useJUnitPlatform()
|
||||
scanForTestClasses = true
|
||||
group = "verification"
|
||||
|
||||
// add jvm arg to resolve BlockHound issues, see https://github.com/reactor/BlockHound/issues/33
|
||||
jvmArgs += [
|
||||
"-XX:+AllowRedefinitionToAddDeleteMethods"
|
||||
]
|
||||
|
||||
testLogging {
|
||||
exceptionFormat = "full"
|
||||
events = ["passed", "skipped", "failed"]
|
||||
}
|
||||
|
||||
// print failed tests after the execution
|
||||
def failedTests = []
|
||||
afterTest { test, result ->
|
||||
if (result.resultType == TestResult.ResultType.FAILURE) {
|
||||
failedTests << test
|
||||
}
|
||||
}
|
||||
|
||||
// create a summary after the execution
|
||||
afterSuite { desc, result ->
|
||||
if (!desc.parent) {
|
||||
println "\nTest result: ${result.resultType}"
|
||||
println "Test summary: ${result.testCount} tests, " +
|
||||
"${result.successfulTestCount} succeeded, " +
|
||||
"${result.failedTestCount} failed, " +
|
||||
"${result.skippedTestCount} skipped"
|
||||
|
||||
failedTests.each { test -> println "FAILED test: ${test.className} > ${test.name}" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
configure(rootProject) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
FROM harbor-repo.vmware.com/dockerhub-proxy-cache/library/ubuntu:bionic
|
||||
|
||||
ARG CONCOURSE_JAVA_SCRIPTS_VERSION=0.0.4
|
||||
ARG CONCOURSE_RELEASE_SCRIPTS_VERSION=0.3.4
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates net-tools git curl jq gnupg
|
||||
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
@@ -10,5 +13,5 @@ RUN mkdir -p /opt/openjdk && \
|
||||
cd /opt/openjdk && \
|
||||
curl -L https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.5%2B8/OpenJDK17U-jdk_x64_linux_hotspot_17.0.5_8.tar.gz | tar xz --strip-components=1
|
||||
|
||||
ADD https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v0.0.4/concourse-java.sh /opt/
|
||||
ADD https://repo.spring.io/libs-snapshot/io/spring/concourse/releasescripts/concourse-release-scripts/0.3.4-SNAPSHOT/concourse-release-scripts-0.3.4-SNAPSHOT.jar /opt/
|
||||
ADD "https://raw.githubusercontent.com/spring-io/concourse-java-scripts/v$CONCOURSE_JAVA_SCRIPTS_VERSION/concourse-java.sh" /opt/
|
||||
ADD "https://repo.spring.io/ui/native/snapshot/io/spring/concourse/releasescripts/concourse-release-scripts/$CONCOURSE_RELEASE_SCRIPTS_VERSION/concourse-release-scripts-$CONCOURSE_RELEASE_SCRIPTS_VERSION.jar" /opt/
|
||||
|
||||
@@ -17,14 +17,14 @@
|
||||
import org.springframework.boot.gradle.plugin.SpringBootPlugin
|
||||
|
||||
plugins {
|
||||
id 'org.asciidoctor.jvm.convert'
|
||||
id 'org.asciidoctor.jvm.convert' version '3.3.2'
|
||||
id 'org.springframework.boot' apply false
|
||||
}
|
||||
|
||||
description = "Spring CredHub Documentation"
|
||||
|
||||
configurations {
|
||||
docs
|
||||
asciidoctorExtensions
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -33,16 +33,15 @@ dependencies {
|
||||
implementation("io.projectreactor:reactor-core")
|
||||
implementation("org.springframework.boot:spring-boot-autoconfigure")
|
||||
|
||||
docs("io.spring.docresources:spring-doc-resources:0.2.5@zip")
|
||||
asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.7"
|
||||
}
|
||||
|
||||
javadoc {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
task prepareAsciidocBuild(type: Sync) {
|
||||
dependsOn configurations.docs
|
||||
// copy doc resources
|
||||
from {
|
||||
configurations.docs.collect { zipTree(it) }
|
||||
}
|
||||
// and doc sources
|
||||
// Copy doc sources
|
||||
from "src/docs/asciidoc"
|
||||
// to a temporary build directory
|
||||
into "$buildDir/asciidoc"
|
||||
@@ -50,6 +49,10 @@ task prepareAsciidocBuild(type: Sync) {
|
||||
|
||||
asciidoctor {
|
||||
baseDirFollowsSourceFile()
|
||||
configurations "asciidoctorExtensions"
|
||||
outputOptions {
|
||||
backends "spring-html"
|
||||
}
|
||||
sourceDir = file("$buildDir/asciidoc")
|
||||
sources {
|
||||
include '*.adoc'
|
||||
@@ -60,17 +63,14 @@ asciidoctor {
|
||||
}
|
||||
}
|
||||
logDocuments = true
|
||||
// backends = ["html5"]
|
||||
options doctype: 'book', eruby: 'erubis'
|
||||
attributes 'icons': 'font',
|
||||
attributes 'revnumber': project.version,
|
||||
'spring-version': project.version,
|
||||
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'main' : "v${project.version}",
|
||||
'icons': 'font',
|
||||
'idprefix': '',
|
||||
'idseparator': '-',
|
||||
docinfo: 'shared',
|
||||
revnumber: project.version,
|
||||
'spring-version': "${springVersion}",
|
||||
'spring-boot-version': "${springBootVersion}",
|
||||
'spring-security-version': "${springSecurityVersion}",
|
||||
'branch-or-tag': project.version.endsWith('SNAPSHOT') ? 'main' : "v${project.version}",
|
||||
sectanchors: '',
|
||||
sectnums: '',
|
||||
stylesdir: "css/",
|
||||
@@ -80,9 +80,8 @@ asciidoctor {
|
||||
'allow-uri-read': '',
|
||||
'source-highlighter': 'highlight.js',
|
||||
'highlightjsdir': 'js/highlight',
|
||||
'highlightjs-theme': 'github'
|
||||
'highlightjs-theme': 'github',
|
||||
'project-version': project.version
|
||||
}
|
||||
|
||||
asciidoctor.dependsOn prepareAsciidocBuild
|
||||
|
||||
configurations.archives.artifacts.clear()
|
||||
|
||||
Reference in New Issue
Block a user