Skip to content

Commit 2b09dfd

Browse files
authored
Merge branch 'master' into jenkins_2025_maintenance
2 parents b408d13 + f4def23 commit 2b09dfd

84 files changed

Lines changed: 10294 additions & 785 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/continuous-integration-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ jobs:
180180
name: Checkout repository
181181
uses: actions/checkout@v4.2.2
182182
-
183-
name: Setup Go 1.18
183+
name: Setup Go 1.24
184184
uses: actions/setup-go@v5
185185
with:
186-
go-version: 1.18
186+
go-version: 1.24
187187
-
188188
name: Verify all Go files are formatted with gofmt
189189
working-directory: tests
@@ -201,7 +201,7 @@ jobs:
201201
name: Verify all Go tests pass linting
202202
uses: golangci/golangci-lint-action@v6
203203
with:
204-
version: v1.49.0
204+
version: v1.64.7
205205
working-directory: tests
206206
args: --timeout=10m
207207
-

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ output-vmware-iso
2121
prov-app-config.txt
2222
headers.txt
2323
response.txt
24+
.cache/

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
### Added
66

77
### Changed
8-
- Jenkins master and agent maintenance. Add Rhel9 variant and make it default ([#1361](https://github.com/opendevstack/ods-core/pull/1361))
8+
- Jenkins master and agent maintenance. Add Rhel9 variant and make it default ([#1361](https://github.com/opendevstack/ods-core/pull/1361))
9+
- Improved automatic tests for the quickstarters ([#1362](https://github.com/opendevstack/ods-core/pull/1362))
10+
- Update keystore path in import_certs.sh script ([#1365](https://github.com/opendevstack/ods-core/pull/1365))
11+
- Added allure plugin and command line installation to jenkins master image ([#1364](https://github.com/opendevstack/ods-core/pull/1364))
912

1013
### Fixed
1114

jenkins/master/Dockerfile.ubi8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ USER root
1818
COPY yum.repos.d/ubi8.repo /etc/yum.repos.d/ubi.repo
1919

2020
COPY ./scripts_for_usr-local-bin/* /usr/local/bin/
21-
RUN rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key \
21+
RUN rpm --import https://pkg.jenkins.io/rpm-stable/jenkins.io-2026.key \
2222
&& disable_yum_repository.sh /etc/yum.repos.d/ci-rpm-mirrors.repo \
2323
/etc/yum.repos.d/localdev-* /etc/yum.repos.d/epel.repo \
2424
&& ensure_java_jre_is_adequate.sh master \
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import jenkins.model.Jenkins
2+
import hudson.tools.InstallSourceProperty
3+
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation
4+
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstaller
5+
6+
def toolName = "Allure"
7+
def allureVersion = "2.34.0"
8+
9+
def j = Jenkins.get()
10+
def desc = j.getDescriptorByType(AllureCommandlineInstallation.DescriptorImpl)
11+
12+
def current = (desc.getInstallations() ?: []) as AllureCommandlineInstallation[]
13+
def already = current.find { it?.name == toolName }
14+
15+
if (already) {
16+
println("[init] Allure Commandline '${toolName}' already exists. Skipping.")
17+
return
18+
}
19+
20+
def installer = new AllureCommandlineInstaller(allureVersion)
21+
def prop = new InstallSourceProperty([installer])
22+
23+
def newInst = new AllureCommandlineInstallation(
24+
toolName,
25+
"",
26+
[prop]
27+
)
28+
29+
def updated = (current.toList() + newInst) as AllureCommandlineInstallation[]
30+
desc.setInstallations(updated)
31+
desc.save()
32+
33+
println("[init] Allure Commandline '${toolName}' configured (version ${allureVersion})")

jenkins/master/plugins.ubi8.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
greenballs:1.15.1
33
sonar:2.17.2
44
ansicolor:1.0.4
5+
allure-jenkins-plugin:2.34.0
56
audit-trail:361.v82cde86c784e
67
Office-365-Connector:5.0.0
78
mask-passwords:173.v6a_077a_291eb_5

ods-provisioning-app/docker/import_certs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eu
44
if [[ ! -z ${APP_DNS:=""} ]]; then
55
echo "Setting up certificates from APP_DNS=${APP_DNS} ..."; \
66

7-
KEYSTORE="$JAVA_HOME/lib/security/cacerts"
7+
KEYSTORE="/opt/java/openjdk/lib/security/cacerts"
88

99
arrIN=(${APP_DNS//;/ })
1010
for val in "${arrIN[@]}";
@@ -22,4 +22,4 @@ if [[ ! -z ${APP_DNS:=""} ]]; then
2222
echo "Done with certificate setup"
2323
else
2424
echo 'No certificates to import'
25-
fi
25+
fi

tests/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ QS := ods-quickstarters/...
99

1010
### By default we do not parallelize tests
1111
PARALLEL := 1
12+
PROJECT := unitt
1213

1314
## Full test of existing ODS core installation. Caution: Creates UNITT project and ODSVERIFY project.
1415
test: smoketest verify test-create-projects
@@ -35,12 +36,13 @@ test-create-projects:
3536

3637
## Run quickstarter tests within existing ODS installation. Depends on UNITT project.
3738
test-quickstarter:
38-
@(./quickstarter-test.sh $(QS) $(PARALLEL))
39+
@(./quickstarter-test.sh -p $(PROJECT) -q $(QS) -pa $(PARALLEL))
3940
.PHONY: test-quickstarter
4041

4142
## Install tools required for tests.
4243
prep-tools:
4344
which go-junit-report || go get github.com/jstemmer/go-junit-report
45+
which golangci-lint || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.50.0
4446
.PHONY: prep-tools
4547

4648
## Lint

tests/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,42 @@ Run `make test` [in this directory](Makefile), which will execute project creati
2525
## Running the quickstarter tests
2626
Run `make test-quickstarter` [in this directory](Makefile). By default, this will test all quickstarters in `ods-quickstarters` located next to `ods-core`. You can run just one specific quickstarter test with `make test-quickstarter QS=be-golang-plain` or run tests located in a custom directory like this: `make test-quickstarter QS=my-quickstarters/...` or `make test-quickstarter QS=my-quickstarters/foobar`. By default all tests run sequentially. To run some in parallel, use e.g. `make test-quickstarter PARALLEL=3`.
2727

28+
### Keeping resources after tests
29+
By default, the quickstarter tests clean up all created resources (OpenShift resources, Helm releases, etc.) after each test completes. To keep the resources for debugging or inspection purposes, set the `KEEP_RESOURCES` environment variable:
30+
31+
```bash
32+
KEEP_RESOURCES=true make test-quickstarter QS=be-python-flask
33+
```
34+
35+
Or for the shell script:
36+
```bash
37+
KEEP_RESOURCES=true ./dev-test.sh be-python-flask e2etsqs
38+
```
39+
40+
**Note:** Port-forward cleanup is handled separately and will still occur to prevent resource leaks.
41+
2842
## Authoring quickstarter tests
2943
Quickstarters must have a `testdata` directory, which needs to contain a `steps.yml` file describing which test steps to execute in YAML format. The allowed fields are defined by https://pkg.go.dev/github.com/opendevstack/ods-core/tests/quickstarter. Typically, the `testdata` directory will also contain a `golden` folder with JSON files describing the expected results. See https://github.com/opendevstack/ods-quickstarters/tree/master/be-golang-plain/testdata as an example.
44+
45+
### Specifying namespace for OpenShift resource verification
46+
47+
When verifying OpenShift resources, you can optionally specify a custom namespace. If not specified, the verification defaults to the `{{.ProjectID}}-dev` namespace.
48+
49+
Example in `testdata/steps.yml`:
50+
51+
```yaml
52+
- type: provision
53+
provisionParams:
54+
verify:
55+
openShiftResources:
56+
namespace: "test" # Will check in {{.ProjectID}}-test
57+
services:
58+
- "{{.ComponentID}}"
59+
deploymentConfigs:
60+
- "{{.ComponentID}}"
61+
```
62+
63+
You can also specify a full namespace (with project prefix):
64+
```yaml
65+
namespace: "{{.ProjectID}}-cd" # Explicit full namespace
66+
```

tests/create-projects/jenkinsfile_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import (
55
"crypto/tls"
66
"encoding/json"
77
"fmt"
8-
"io/ioutil"
8+
"io"
99
"net/http"
10+
"os"
1011
"path"
1112
"runtime"
1213
"strings"
@@ -101,7 +102,7 @@ func TestCreateProjectThruWebhookProxyJenkinsFile(t *testing.T) {
101102

102103
defer reponse.Body.Close()
103104

104-
bodyBytes, _ := ioutil.ReadAll(reponse.Body)
105+
bodyBytes, _ := io.ReadAll(reponse.Body)
105106

106107
if reponse.StatusCode >= http.StatusAccepted {
107108
t.Fatalf("Could not post request: %s", string(bodyBytes))
@@ -154,7 +155,7 @@ func TestCreateProjectThruWebhookProxyJenkinsFile(t *testing.T) {
154155
t.Fatal(err)
155156
}
156157

157-
expected, err := ioutil.ReadFile("golden/jenkins-create-project-stages.json")
158+
expected, err := os.ReadFile("golden/jenkins-create-project-stages.json")
158159
if err != nil {
159160
t.Fatal(err)
160161
}

0 commit comments

Comments
 (0)