Skip to content

Commit 2b66a8f

Browse files
Add golden e2e tests for ibm-mq-metrics
1 parent 54e054e commit 2b66a8f

File tree

7 files changed

+1791
-0
lines changed

7 files changed

+1791
-0
lines changed

.github/workflows/e2e.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Run End to End tests for IBM MQ Metrics
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- ibm-mq-metrics/**
8+
pull_request:
9+
paths:
10+
- ibm-mq-metrics/**
11+
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
e2e:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Cache Docker images.
21+
uses: AndreKurait/docker-cache@0fe76702a40db986d9663c24954fc14c6a6031b7 # 0.6.0
22+
with:
23+
key: docker-mq-e2e
24+
- name: Checkout code
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
27+
- name: Set up JDK for running Gradle
28+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
29+
with:
30+
distribution: temurin
31+
java-version: 11
32+
33+
- name: Set up gradle
34+
uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2
35+
with:
36+
cache-read-only: ${{ github.event_name == 'pull_request' }}
37+
38+
- name: Build the jar
39+
run: |
40+
./gradlew ibm-mq-metrics:clean ibm-mq-metrics:shadowJar
41+
42+
- name: Make a local copy of the ibm client jar
43+
run: |
44+
./gradlew ibm-mq-metrics:copyIbmClientJar
45+
46+
- name: Start MQ and the test services
47+
run: |
48+
cd ibm-mq-metrics/golden
49+
docker compose up -d --wait
50+
51+
- name: Run the integration
52+
run: |
53+
cd ibm-mq-metrics/golden
54+
./run.sh &
55+
exit_code=$(docker wait golden)
56+
docker logs golden
57+
if [ "$exit_code" -ne 0 ]; then
58+
exit 1
59+
fi
60+
61+
- name: Notify failed build
62+
uses: jayqi/failed-build-issue-action@1a893bbf43ef1c2a8705e2b115cd4f0fe3c5649b # v1.2.0
63+
if: failure() && github.event.pull_request == null
64+
with:
65+
github-token: ${{ secrets.GITHUB_TOKEN }}

ibm-mq-metrics/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.gradle.kotlin.dsl.provideDelegate
2+
13
plugins {
24
application
35
id("com.gradleup.shadow")
@@ -63,6 +65,16 @@ tasks.shadowJar {
6365
}
6466
}
6567

68+
tasks {
69+
// This exists purely to get the IBM jar into our build dir
70+
val copyIbmClientJar by registering(Jar::class) {
71+
archiveFileName.set("com.ibm.mq.allclient.jar")
72+
doFirst {
73+
from(zipTree(ibmClientJar.singleFile))
74+
}
75+
}
76+
}
77+
6678
val integrationTest = tasks.register<Test>("integrationTest") {
6779
description = "Runs integration tests."
6880
group = "verification"

ibm-mq-metrics/golden/config.yml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
#Run it as a scheduled task instead of running every minute.
2+
#If you want to run this every minute, comment this out
3+
#taskSchedule:
4+
# numberOfThreads: 20
5+
# taskDelaySeconds: 300
6+
7+
#This is the timeout on queue metrics and channel metrics threads.Default value is 20 seconds.
8+
#No need to change the default unless you know what you are doing.
9+
#queueMetricsCollectionTimeoutInSeconds: 40
10+
#channelMetricsCollectionTimeoutInSeconds: 40
11+
#topicMetricsCollectionTimeoutInSeconds: 40
12+
13+
queueManagers:
14+
- name: "QM1"
15+
host: "0.0.0.0"
16+
port: 1414
17+
18+
# Indicate the MaxActiveChannels as set in qm.ini, see https://www.ibm.com/docs/en/ibm-mq/9.3.x?topic=qmini-channels-stanza-file
19+
maxActiveChannels: 4200
20+
21+
#The transport type for the queue manager connection, the default is "Bindings" for a binding type connection
22+
#For bindings type, connection WMQ extension (i.e machine agent) need to be on the same machine on which WebbsphereMQ server is running
23+
#For client type, connection change it to "Client".
24+
transportType: "Client"
25+
26+
#Channel name of the queue manager, channel should be server-conn type.
27+
#This field is not required in case of transportType: Bindings
28+
channelName: DEV.ADMIN.SVRCONN
29+
30+
#for user access level, please check "Access Permissions" section on the extensions page
31+
#comment out the username and password in case of transportType: Bindings.
32+
username: "admin"
33+
password: "passw0rd"
34+
35+
#PCF requests are always sent to SYSTEM.ADMIN.COMMAND.QUEUE. The PCF responses to these requests are sent to the default reply-to queue called
36+
#SYSTEM.DEFAULT.MODEL.QUEUE. However, you can override this behavior and send it to a temporary dynamic queue by changing the modelQueueName and replyQueuePrefix fields.
37+
#For more details around this https://www.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.adm.doc/q083240_.htm & https://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.adm.doc/q020010_.htm
38+
#modelQueueName: ""
39+
#replyQueuePrefix: ""
40+
41+
# Name of the temporary dynamic queue holding the configuration events. This queue contains information regarding the configuration of the queue manager, notable MaxChannels and MaxActiveChannels.
42+
# If unset, the default queue name `SYSTEM.ADMIN.CONFIG.EVENT` is applied.
43+
# Configuration events need to be enabled explicitly in the queue manager configuration. See https://www.ibm.com/docs/en/ibm-mq/9.4.x?topic=monitoring-configuration-events for reference.
44+
#configurationQueueName: "SYSTEM.ADMIN.CONFIG.EVENT"
45+
46+
# Interval in milliseconds at which the configuration events in the configuration queue can be consumed.
47+
# By default, no events are consumed.
48+
#consumeConfigurationEventInterval: 600000 # 10 minutes
49+
50+
# Enable running a queue manager refresh request to reload its configuration and create a configuration event.
51+
# This action is only executed if no configuration events are found when reading the configuration queue.name:
52+
# By default, this action is disabled.
53+
#refreshQueueManagerConfigurationEnabled: false
54+
55+
#Sets the CCSID used in the message descriptor of request and response messages. The default value is MQC.MQCCSI_Q_MGR.
56+
#To set this, please use the integer value.
57+
#ccsid:
58+
59+
#Sets the encoding used in the message descriptor of request and response messages. The default value is MQC.MQENC_NATIVE.
60+
#To set this, please use the integer value.
61+
#encoding:
62+
63+
# IBM Cipher Suite e.g. "SSL_RSA_WITH_AES_128_CBC_SHA256"..
64+
# For translation to IBM Cipher http://www.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q113210_.htm
65+
# A cipher working for IBM Cloud MQ and Temurin JDK 8 is TLS_AES_128_GCM_SHA256
66+
#cipherSuite: "TLS_AES_128_GCM_SHA256"
67+
68+
69+
queueFilters:
70+
#Can provide complete queue name or generic names. A generic name is a character string followed by an asterisk (*),
71+
#for example ABC*, and it selects all objects having names that start with the selected character string.
72+
#An asterisk on its own matches all possible names.
73+
include: ["*"]
74+
exclude:
75+
#type value: STARTSWITH, EQUALS, ENDSWITH, CONTAINS
76+
- type: "STARTSWITH"
77+
#The name of the queue or queue name pattern as per queue filter, comma separated values
78+
values: ["SYSTEM","AMQ"]
79+
80+
81+
channelFilters:
82+
#Can provide complete channel name or generic names. A generic name is a character string followed by an asterisk (*),
83+
#for example ABC*, and it selects all objects having names that start with the selected character string.
84+
#An asterisk on its own matches all possible names.
85+
include: ["*"]
86+
exclude:
87+
#type value: STARTSWITH, EQUALS, ENDSWITH, CONTAINS
88+
- type: "STARTSWITH"
89+
#The name of the queue or queue name pattern as per queue filter, comma separated values
90+
values: ["SYSTEM"]
91+
92+
listenerFilters:
93+
#Can provide complete channel name or generic names. A generic name is a character string followed by an asterisk (*),
94+
#for example ABC*, and it selects all objects having names that start with the selected character string.
95+
#An asterisk on its own matches all possible names.
96+
include: ["*"]
97+
exclude:
98+
#type value: STARTSWITH, EQUALS, ENDSWITH, CONTAINS
99+
- type: "STARTSWITH"
100+
#The name of the queue or queue name pattern as per queue filter, comma separated values
101+
values: ["SYSTEM"]
102+
103+
topicFilters:
104+
# For topics, IBM MQ uses the topic wildcard characters ('#' and '+') and does not treat a trailing asterisk as a wildcard
105+
# https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_7.5.0/com.ibm.mq.pla.doc/q005020_.htm
106+
include: ["#"]
107+
exclude:
108+
#type value: STARTSWITH, EQUALS, ENDSWITH, CONTAINS
109+
- type: "STARTSWITH"
110+
#The name of the queue or queue name pattern as per queue filter, comma separated values
111+
values: ["SYSTEM","$SYS"]
112+
metrics:
113+
"mq.message.retry.count": # Number of message retries
114+
enabled: true
115+
"mq.status": # Channel status
116+
enabled: true
117+
"mq.max.sharing.conversations": # Maximum number of conversations permitted on this channel instance.
118+
enabled: true
119+
"mq.current.sharing.conversations": # Current number of conversations permitted on this channel instance.
120+
enabled: true
121+
"mq.byte.received": # Number of bytes received
122+
enabled: true
123+
"mq.byte.sent": # Number of bytes sent
124+
enabled: true
125+
"mq.buffers.received": # Buffers received
126+
enabled: true
127+
"mq.buffers.sent": # Buffers sent
128+
enabled: true
129+
"mq.message.count": # Message count
130+
enabled: true
131+
"mq.open.input.count": # Count of applications sending messages to the queue
132+
enabled: true
133+
"mq.open.output.count": # Count of applications consuming messages from the queue
134+
enabled: true
135+
"mq.high.queue.depth": # The current high queue depth
136+
enabled: true
137+
"mq.service.interval": # The queue service interval
138+
enabled: true
139+
"mq.queue.depth.full.event": # The number of full queue events
140+
enabled: true
141+
"mq.queue.depth.high.event": # The number of high queue events
142+
enabled: true
143+
"mq.queue.depth.low.event": # The number of low queue events
144+
enabled: true
145+
"mq.uncommitted.messages": # Number of uncommitted messages
146+
enabled: true
147+
"mq.oldest.msg.age": # Queue message oldest age
148+
enabled: true
149+
"mq.current.max.queue.filesize": # Current maximum queue file size
150+
enabled: true
151+
"mq.current.queue.filesize": # Current queue file size
152+
enabled: true
153+
"mq.instances.per.client": # Instances per client
154+
enabled: true
155+
"mq.message.deq.count": # Message dequeue count
156+
enabled: true
157+
"mq.message.enq.count": # Message enqueue count
158+
enabled: true
159+
"mq.queue.depth": # Current queue depth
160+
enabled: true
161+
"mq.service.interval.event": # Queue service interval event
162+
enabled: true
163+
"mq.reusable.log.size": # The amount of space occupied, in megabytes, by log extents available to be reused.
164+
enabled: true
165+
"mq.manager.active.channels": # The queue manager active maximum channels limit
166+
enabled: true
167+
"mq.restart.log.size": # Size of the log data required for restart recovery in megabytes.
168+
enabled: true
169+
"mq.max.queue.depth": # Maximum queue depth
170+
enabled: true
171+
"mq.onqtime.1": # Amount of time, in microseconds, that a message spent on the queue, over a short period
172+
enabled: true
173+
"mq.onqtime.2": # Amount of time, in microseconds, that a message spent on the queue, over a longer period
174+
enabled: true
175+
"mq.message.received.count": # Number of messages received
176+
enabled: true
177+
"mq.message.sent.count": # Number of messages sent
178+
enabled: true
179+
"mq.max.instances": # Max channel instances
180+
enabled: true
181+
"mq.connection.count": # Active connections count
182+
enabled: true
183+
"mq.manager.status": # Queue manager status
184+
enabled: true
185+
"mq.heartbeat": # Queue manager heartbeat
186+
enabled: true
187+
"mq.archive.log.size": # Queue manager archive log size
188+
enabled: true
189+
"mq.manager.max.active.channels": # Queue manager max active channels
190+
enabled: true
191+
"mq.manager.statistics.interval": # Queue manager statistics interval
192+
enabled: true
193+
"mq.publish.count": # Topic publication count
194+
enabled: true
195+
"mq.subscription.count": # Topic subscription count
196+
enabled: true
197+
"mq.listener.status": # Listener status
198+
enabled: true
199+
"mq.unauthorized.event": # Number of authentication error events
200+
enabled: true
201+
"mq.manager.max.handles": # Max open handles
202+
enabled: true
203+
204+
sslConnection:
205+
trustStorePath: ""
206+
trustStorePassword: ""
207+
208+
keyStorePath: ""
209+
keyStorePassword: ""
210+
211+
otlpExporter:
212+
otel.metric.export.interval: 20s
213+
otel.exporter.otlp.protocol: http/protobuf
214+
otel.exporter.otlp.endpoint: http://0.0.0.0:4318
215+
otel.logs.exporter: none
216+
otel.traces.exporter: none

0 commit comments

Comments
 (0)