Browse Source

Work in progress

master
Nicolas Massé 7 years ago
parent
commit
bd3bfe6608
  1. 13
      README.md
  2. 47
      testcase-01/Jenkinsfile

13
README.md

@ -11,3 +11,16 @@ oc create secret generic 3scale-toolbox --from-file=$HOME/.3scalerc.yaml
```sh
oc process -f testcase-01/setup.yaml |oc create -f -
```
## Testcases
| # | Format | Security | Target | Policies |
|--------------------|--------|----------|----------------------------------|---------------------|
| [01](testcase-01/) | YAML | API Key | SaaS | - |
| [02](testcase-02/) | JSON | Open | Self-Managed, on-premises | - |
| [03](testcase-03/) | JSON | OIDC | SaaS, Self-Managed, on-premises | - |
| [04](testcase-04/) | YAML | API Key | Self-Managed, on-premises | CORS |
| [05](testcase-05/) | YAML | API Key | Self-Managed, on-premises | URL rewriting |
| [06](testcase-06/) | YAML | API Key | 3 envs on 1 tenant, Self-managed | - |
| [07](testcase-07/) | JSON | OIDC | 3 envs on 3 tenants, on-premises | CORS, URL rewriting |

47
testcase-01/Jenkinsfile

@ -27,6 +27,9 @@ node() {
stage("Import OpenAPI") {
openshift.withCluster() {
openshift.withProject(params.NAMESPACE) {
// Here we would need to pass the public staging/prod url when using
// APIcast Self-Managed
// See https://issues.jboss.org/browse/THREESCALE-2607
targetSystemName = toolbox.importOpenAPI(openshift: openshift,
destination: params.TARGET_INSTANCE,
toolboxConfig: toolboxConfig,
@ -50,9 +53,47 @@ node() {
}
}
// Create an application
// Integration tests
// Promote to production
stage("Create an Application") {
openshift.withCluster() {
openshift.withProject(params.NAMESPACE) {
toolbox.createApplication(openshift: openshift,
destination: params.TARGET_INSTANCE,
serviceSystemName: targetSystemName,
planSystemName: "test_plan",
applicationName: "My App",
applicationDescription: "Test",
toolboxConfig: toolboxConfig)
}
}
}
stage("Run integration tests") {
openshift.withCluster() {
openshift.withProject(params.NAMESPACE) {
// To run the integration tests when using APIcast SaaS instances, we need
// to fetch the proxy definition to extract the staging public url
def proxy = toolbox.readProxy(openshift: openshift,
destination: params.TARGET_INSTANCE,
serviceSystemName: targetSystemName,
environment: "sandbox",
toolboxConfig: toolboxConfig)
sh '''set -xe
curl ${proxy.sandbox_endpoint}/beers
# TODO
'''
}
}
}
stage("Promote to production") {
openshift.withCluster() {
openshift.withProject(params.NAMESPACE) {
toolbox.promoteToProduction(openshift: openshift,
destination: params.TARGET_INSTANCE,
serviceSystemName: targetSystemName,
toolboxConfig: toolboxConfig)
}
}
}
}

Loading…
Cancel
Save