22# Those tests verify that the chart can be installed and that it correctly configured agent
33# ingestion for various options (daemonset mode, deployment mode, k8s cluster metrics are ingested,
44# pod logs are ingested, etc.)
5+ # NOTE: To reduce the size of the build matrix and speed up test run, we only run single set of tests using both Buster
6+ # and Alpine Linux based Docker image. Rest of the tests only exercise single image.
57name : " End to End Tests"
68
79on :
3840 runs-on : ubuntu-latest
3941
4042 needs : pre_job
43+ timeout-minutes : 15
4144 # NOTE: We always want to run job on main branch
4245 if : ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/main' }}
4346
5558 - name : Checkout Repository
5659 uses : actions/checkout@v3
5760 with :
58- fetch-depth : 0
61+ fetch-depth : 1
5962
6063 - name : Set up Chart Testing Environment and Kubernetes Cluster
6164 uses : ./.github/actions/setup-chart-testing-environment/
@@ -136,6 +139,7 @@ jobs:
136139 runs-on : ubuntu-latest
137140
138141 needs : pre_job
142+ timeout-minutes : 15
139143 # NOTE: We always want to run job on main branch
140144 if : ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/main' }}
141145
@@ -147,13 +151,12 @@ jobs:
147151 - ' v1.24.3'
148152 image_type :
149153 - " buster"
150- - " alpine"
151154
152155 steps :
153156 - name : Checkout Repository
154157 uses : actions/checkout@v3
155158 with :
156- fetch-depth : 0
159+ fetch-depth : 1
157160
158161 - name : Set up Chart Testing Environment and Kubernetes Cluster
159162 uses : ./.github/actions/setup-chart-testing-environment/
@@ -207,6 +210,7 @@ jobs:
207210 runs-on : ubuntu-latest
208211
209212 needs : pre_job
213+ timeout-minutes : 15
210214 # NOTE: We always want to run job on main branch
211215 if : ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/main' }}
212216
@@ -215,16 +219,17 @@ jobs:
215219 matrix :
216220 k8s_version :
217221 - ' v1.22.2'
218- - ' v1.24.3'
222+ # Started randomly failing without any changes on our side. Looks like weird DNS /
223+ # networking issue inside minikube when running on GHA (runs fine locally)
224+ # - 'v1.24.3'
219225 image_type :
220226 - " buster"
221- - " alpine"
222227
223228 steps :
224229 - name : Checkout Repository
225230 uses : actions/checkout@v3
226231 with :
227- fetch-depth : 0
232+ fetch-depth : 1
228233
229234 - name : Set up Chart Testing Environment and Kubernetes Cluster
230235 uses : ./.github/actions/setup-chart-testing-environment/
@@ -242,21 +247,39 @@ jobs:
242247 values_file_path : " ci/daemonset-agent-values-with-k8s-explorer.yaml"
243248 image_type : " ${{ matrix.image_type }}"
244249
250+ - name : Checkout Agent Repository
251+ uses : actions/checkout@v3
252+ with :
253+ repository : " scalyr/scalyr-agent-2"
254+ path : " scalyr-agent-2"
255+ fetch-depth : 1
256+
257+ - name : Set up Docker Buildx
258+ uses : docker/setup-buildx-action@v2
259+
260+ # Here we build the dummy Java app image which exposes JMX metrics via exporter
261+ # TODO: Cache this dummy / test image for faster builds
262+ - name : Build Mock Java App Docker Image
263+ uses : docker/build-push-action@v3
264+ with :
265+ context : scalyr-agent-2/tests/e2e/k8s_om_monitor/java-hello-world/
266+ tags : java-hello-world:latest
267+ # load image into docker
268+ load : true
269+ push : false
270+ # push: true
271+ # tags: localhost:5000/java-hello-world:latest
272+ cache-from : type=gha
273+ cache-to : type=gha,mode=max
274+
245275 # Create mock pods and exporters which will be scrapped by the monitor
246276 # (step taken from scalyr-agent-2 repo)
247277 - name : Create mock pods and exporters
248278 run : |
249279 set -e
250280
251- git clone --depth 1 https://github.com/scalyr/scalyr-agent-2.git
252281 pushd scalyr-agent-2/
253282
254- # Here we build the dummy Java app image which exposes JMX metrics via exporter
255- # TODO: Cache this dummy / test image for faster builds
256- pushd tests/e2e/k8s_om_monitor/java-hello-world
257- docker build -t java-hello-world .
258- popd
259-
260283 docker image ls
261284 minikube image load java-hello-world:latest
262285
@@ -305,6 +328,7 @@ jobs:
305328 runs-on : ubuntu-latest
306329
307330 needs : pre_job
331+ timeout-minutes : 15
308332 # NOTE: We always want to run job on main branch
309333 if : ${{ needs.pre_job.outputs.should_skip != 'true' || github.ref == 'refs/heads/main' }}
310334
@@ -313,16 +337,17 @@ jobs:
313337 matrix :
314338 k8s_version :
315339 - ' v1.22.2'
316- - ' v1.24.3'
340+ # Started randomly failing without any changes on our side. Looks like weird DNS /
341+ # networking issue inside minikube when running on GHA (runs fine locally)
342+ # - 'v1.24.3'
317343 image_type :
318344 - " buster"
319- - " alpine"
320345
321346 steps :
322347 - name : Checkout Repository
323348 uses : actions/checkout@v3
324349 with :
325- fetch-depth : 0
350+ fetch-depth : 1
326351
327352 - name : Set up Chart Testing Environment and Kubernetes Cluster
328353 uses : ./.github/actions/setup-chart-testing-environment/
@@ -340,30 +365,42 @@ jobs:
340365 values_file_path : " ci/daemonset-agent-values-with-k8s-explorer-with-deps.yaml"
341366 image_type : " ${{ matrix.image_type }}"
342367
368+ - name : Checkout Agent Repository
369+ uses : actions/checkout@v3
370+ with :
371+ repository : " scalyr/scalyr-agent-2"
372+ path : " scalyr-agent-2"
373+ fetch-depth : 1
374+
375+ - name : Set up Docker Buildx
376+ uses : docker/setup-buildx-action@v2
377+
378+ # Here we build the dummy Java app image which exposes JMX metrics via exporter
379+ # TODO: Cache this dummy / test image for faster builds
380+ - name : Build Mock Java App Docker Image
381+ uses : docker/build-push-action@v3
382+ with :
383+ context : scalyr-agent-2/tests/e2e/k8s_om_monitor/java-hello-world/
384+ tags : java-hello-world:latest
385+ # load image into docker
386+ load : true
387+ push : false
388+ # push: true
389+ # tags: localhost:5000/java-hello-world:latest
390+ cache-from : type=gha
391+ cache-to : type=gha,mode=max
392+
343393 - name : Create mock pods and exporters
344394 run : |
345395 set -e
346396
347- git clone --depth 1 https://github.com/scalyr/scalyr-agent-2.git
348397 pushd scalyr-agent-2/
349398
350- # Here we build the dummy Java app image which exposes JMX metrics via exporter
351- # TODO: Cache this dummy / test image for faster builds
352- pushd tests/e2e/k8s_om_monitor/java-hello-world
353- docker build -t java-hello-world .
354- popd
355-
356399 docker image ls
357400 minikube image load java-hello-world:latest
358401
359402 kubectl create namespace monitoring
360403
361- # 1. node exporter pod
362- kubectl apply -f tests/e2e/k8s_om_monitor/node_exporter.yaml
363-
364- # 2. kube state metrics deployment
365- kubectl apply -k tests/e2e/k8s_om_monitor/kube-state-metrics/
366-
367404 # 3. Install dummy java app container with jmx exporter side
368405 kubectl apply -f tests/e2e/k8s_om_monitor/java_app_deployment.yaml
369406 popd
@@ -372,7 +409,7 @@ jobs:
372409 kubectl get pods -A
373410
374411 # Verify dependencies have been installed and are running
375- echo "Verifying node-exporter and kube-state-metrics pods are running"
412+ echo "Verifying node-exporter and kube-state-metrics pods are running"
376413 kubectl get pods -A | grep node-exporter
377414 kubectl get pods -A | grep kube-state-metrics
378415
0 commit comments