Urgent.News

What's breaking now, across thousands of outlets.

Tech

Testing Across Everything: Mastering Matrix Builds & Parallelism in GitLab CI/CD

Testing Across Everything: Mastering Matrix Builds & Parallelism in GitLab CI/CD When maintaining an open-source library, cross-platform CLI tool, or multi-tenant backend, you can never assume that code passing on Node.js 22 or Python 3.12 on Linux will run without errors on Node 18 or Python 3.10 on macOS. Historically, testing multiple versions in CI meant one of two terrible options: The…

Testing Across Everything: Mastering Matrix Builds & Parallelism in GitLab CI/CD

Maintaining libraries across multiple platforms requires thorough testing of various language versions, database engines, and CPU architectures. Historically, this meant either a slow sequential process or duplicating CI job configuration multiple times. GitLab CI/CD introduces native Parallel Matrix Builds to efficiently test dozens of combinations concurrently.

Key concepts include:

1. Parallel Matrix Builds allow a single job definition to generate multiple parallel jobs. For Node.js on various Alpine versions, you can define parallel: matrix: - NODE_VERSION: [18-alpine, 20-alpine, 22-alpine] script: - node -v - npm ci - npm test. This creates 6 simultaneous jobs, reducing total test time significantly.

2. Multi-dimensional matrices combine runtime versions with databases. For Python backends supporting Postgres and MySQL, you can test combinations like Python 3.11 on Postgres and Python 3.12 on MySQL in parallel. GitLab computes the Cartesian product, generating 4 jobs for the example.

3. Exclusions are possible by defining multiple matrix arrays. For instance, Python 3.10 might be unsupported on certain architectures. You can separate Linux and ARM64 targets into distinct matrix blocks.

4. Sharding test suites for speed is possible when test count exceeds the number of matrix permutations. Using parallel: 4 on a 2,000-test suite allows GitLab to automatically divide the workload among 4 concurrent runners, executing individual test subsets in parallel.

5. The key takeaway is to avoid duplicated YAML by leveraging GitLab's dynamic generation of matrix permutations through parallel: matrix: . This leads to true concurrent feedback, cutting validation time to the duration of a single job run. Caching should still be implemented, but partitioned by runtime version to prevent issues.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

BERT's tokenizer bottleneck was hiding before WordPiece

BERT's tokenizer bottleneck was hiding before WordPiece Normalization consumed 88% of a warm English encoding pass with bert-base-uncased . WordPiece, the algorithm that chooses tokens, took 8%.

  • BERT tokenizer bottleneck hidden before WordPiece
  • WordPiece accounted for 88% of warm English encoding pass
  • Proposed branch improved BERT encoding 50x

Connected steps are not a workflow

Take a task that crosses two apps. A customer asks for a refund. The request lives in the support desk. The order lives in the billing system.

  • Refund request exists in support desk, order in billing system
  • Refunds over $50 require manager approval, not defined in API
  • No confirmation of refund processing before customer note sent

Zero-Latency Motion Tracking with OpenCV

Heavy machine learning models don't work everywhere, especially not on the edge where computing power is not as good. I have recently developed a simple and fast working procedure to achieve motion…

More from Friday 16 October →