RousselTMLEARNING

TP · Grafana k6: load and performance testing

Final Lab: Blocking performance test in continuous integration

What you will learn in this TP
  • Write a smoke test for CI
  • Create the workflow
  • Observe a blocked pull request

Introduction #

What you will learn in this section
  • Write a smoke test for CI
  • Create the workflow
  • Observe a blocked pull request

Context. A performance regression reached production last month. From now on, no pull request may degrade latency beyond the SLO.

Prerequisites: GitHub account, test repository  ·  Estimated time: 40 min

Performance tested on every change.

Hands-on #

Guided steps, with their solutions.

  1. 1. Prepare the repository

    Why? The test lives next to the code it protects.

    In a repository, create docker-compose.yml (httpbin on port 8080) and tests/perf/smoke.js (10 VUs, 30 s, thresholds p95 < 300 ms and failures < 1%) targeting http://localhost:8080/get.
  2. 2. Write the workflow

    Why? The official actions install k6 and run the script; an unmet threshold fails the job.

    Create .github/workflows/perf.yml, triggered on pull requests.
  3. 3. Open a healthy pull request

    Why? To check the nominal path.

    Push to a branch and open a pull request: the job should succeed.
  4. 4. Simulate a regression

    Why? Proof that the safeguard works.

    Change the tested route to /delay/1 (simulating slower code), push and observe the result.

Difficulty level : ●●●○○ (3/5)

My progress

  • ⏱ Estimated time : ≈ 40 min

Sign in to track your progress and take notes. Sign in

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Observing a k6 test: Prometheus, Grafana and correlation with the system under test

Send k6 results to Prometheus (remote write) or via OpenTelemetry, visualize them in Grafana and ...

End-to-end CI/CD (5/5): GitHub Actions, GitLab CI, Jenkins and Argo CD in practice

Compare and use CI/CD tools: GitHub Actions, GitLab CI, Jenkins, Argo CD and Flux; a complete pip...

Grafana Alloy: Continuous Profiling with Pyroscope

Discover how to configure continuous profiling in your environments using Grafana Alloy and Pyros...

Ansible: going further (testing, quality, CI/CD and performance)

Industrialize Ansible: ansible-lint, yamllint, Molecule, continuous integration, collections, exe...

HAProxy in Kubernetes: the high-performance Ingress Controller

Discover in depth how HAProxy integrates with Kubernetes: direct-to-pod architecture, hot update ...

Advanced infrastructure with Datadog: network, cloud, containers and databases

Monitor infrastructure beyond hosts: Network Performance Monitoring, AWS, Azure and GCP integrati...

Git for DevOps: branches, code reviews and versions

Organize work with Git in a DevOps approach: trunk-based development or GitFlow, short-lived bran...

Real User Monitoring (RUM) and Core Web Vitals: measuring what users experience

Why observe the front end, what RUM measures, Core Web Vitals (LCP, INP, CLS) and their threshold...

Browser testing and synthetic monitoring with k6

Test a web application in a real browser with the k6 browser module, measure Core Web Vitals, and...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!