Skip to content

Commit

Permalink
Ref #32380: improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LEDfan committed Feb 22, 2024
1 parent 7a7e845 commit 386bca2
Show file tree
Hide file tree
Showing 22 changed files with 50 additions and 42 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [ 11 ]
java: [ 17 ]
kubernetes:
- 'v1.24.17'
- 'v1.25.15'
Expand All @@ -35,9 +35,10 @@ jobs:
minikube version: 'v1.32.0'
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}
driver: docker
- name: Pull images
run: |
minikube image pull openanalytics/shinyproxy-demo
minikube image pull openanalytics/shinyproxy-integration-test-app
minikube image pull curlimages/curl:latest
- name: Build with Maven
run: mvn -B -U clean install -DskipTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [scientists, mathematicians]
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [scientists, mathematicians]
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [ scientists, mathematicians ]
kubernetes-pod-patches: |
- op: replace
path: /metadata/namespace
value: my-namespace
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [scientists, mathematicians]
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [scientists, mathematicians]
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ spec:
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: [scientists, mathematicians]
- id: 06_tabsets
container-cmd: ["R", "-e", "shinyproxy::run_06_tabsets()"]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
access-groups: scientists
- id: rstudio
displayName: RStudio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MockRecyclableChecker : IRecyclableChecker {
@Volatile
var isRecyclable: Boolean = false

override fun isInstanceRecyclable(shinyProxy: ShinyProxy, shinyProxyInstance: ShinyProxyInstance): Boolean {
override suspend fun isInstanceRecyclable(shinyProxy: ShinyProxy, shinyProxyInstance: ShinyProxyInstance): Boolean {
return isRecyclable
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ class TestExecutionListener : SummaryGeneratingListener() {

init {
Runtime.getRuntime().addShutdownHook(Thread {
summary.printTo(PrintWriter(System.out))
if (summary != null) {
summary.printTo(PrintWriter(System.out))
}
})
}

Expand Down Expand Up @@ -57,7 +59,10 @@ class TestExecutionListener : SummaryGeneratingListener() {

println()
println("\t\t--> Finished test \"${testIdentifier.displayName}\": $testExecutionResult")
if (testExecutionResult.throwable.isPresent) {
testExecutionResult.throwable.get().printStackTrace()
}
println()
}

}
}
4 changes: 2 additions & 2 deletions src/test/resources/configs/additional_fqdns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
4 changes: 2 additions & 2 deletions src/test/resources/configs/affinity_required.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
4 changes: 2 additions & 2 deletions src/test/resources/configs/affinity_topologykey.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
2 changes: 1 addition & 1 deletion src/test/resources/configs/conflict.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: sp-example-shinyproxy-cm-f5b84adc3f917d9256a0c779fd53080f13033e
name: sp-example-shinyproxy-cm-a2460e4e35bfd14f72413e02ac6acfd0d33d7e
namespace: itest
data:
application.yml: |
Expand Down
5 changes: 3 additions & 2 deletions src/test/resources/configs/simple_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
authentication: simple
containerBackend: kubernetes
stop-proxies-on-shutdown: false
default-stop-proxy-on-logout: false
kubernetes:
namespace: itest
internal-networking: true
Expand All @@ -30,7 +31,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
4 changes: 2 additions & 2 deletions src/test/resources/configs/simple_config_clustered.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
kubernetes-pod-patches: |
- op: replace
path: /metadata/namespace
value: my-namespace
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
appNamespaces:
- my-namespace
4 changes: 2 additions & 2 deletions src/test/resources/configs/simple_config_subpath1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
server:
servlet:
context-path: /sub-path
4 changes: 2 additions & 2 deletions src/test/resources/configs/simple_config_subpath2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
server:
servlet:
context-path: /sub-path/
5 changes: 3 additions & 2 deletions src/test/resources/configs/simple_config_updated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ spec:
authentication: simple
containerBackend: kubernetes
stop-proxies-on-shutdown: false
default-stop-proxy-on-logout: false
kubernetes:
namespace: itest
internal-networking: true
Expand All @@ -30,7 +31,7 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
kubernetesIngressPatches: |
- op: add
path: /metadata/annotations
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/configs/simple_config_with_patches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
kubernetesPodTemplateSpecPatches: |
- op: add
path: /spec/containers/0/env/-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ spec:
displayName: Hello Application
description: Application which demonstrates the basics of a Shiny app
containerCmd: [ "R", "-e", "shinyproxy::run_01_hello()" ]
containerImage: openanalytics/shinyproxy-demo
containerImage: openanalytics/shinyproxy-integration-test-app
- id: 06_tabsets
container-cmd: [ "R", "-e", "shinyproxy::run_06_tabsets()" ]
container-image: openanalytics/shinyproxy-demo
container-image: openanalytics/shinyproxy-integration-test-app
kubernetesServicePatches: |
- op: add
path: /metadata/annotations
Expand Down

0 comments on commit 386bca2

Please sign in to comment.