Build matrix overrides

ahigginscassidy's Avatar

ahigginscassidy

16 Apr, 2021 03:00 PM

Hey all.
I'm trying to override test scripts in a build matrix. I have a 3x2 matrix, but only need half to be run at any given time.

image: Ubuntu

platform:
  - electron
  - linux
  - simulator

configuration:
  - production
  - qa

environment:
  nodejs_version: 12.20.2
  DEPENDENCY: 0
  APP_VERSION: 1
  BUILD_POSTFIX: -nightly

version: '${APP_VERSION}-{build}'

test_script:
  - echo "Default should always be overridden"

for:
  -
    matrix:
      only:
        - configuration: qa
      skip_tags: true
      environment:
        BUILD_POSTFIX: -qa
  -
    matrix:
      only:
        - platform: simulator
    test_script:
      - ./run_sim_tests.sh
  -
    matrix:
      only:
        - platform: linux
    test_script:
      - ./run_linux_tests.sh
  -
    matrix:
      only:
        - configuration: production
      environment:
        BUILD_POSTFIX: -prod

The intention is that the test scripts get overridden for everything linux or simulator in both QA and prod. However the values seem to be ignored. How can I properly merge these values? The documentation explains that matrix dimensions aren't valid in a for construct, but I'm not sure what else to override on.

Setup as an environment variable?
Thanks!

  1. 1 Posted by ahigginscassidy on 16 Apr, 2021 04:08 PM

    ahigginscassidy's Avatar

    A quick way to summarize: I'm trying to add environment to each matrix COLUMN and then have them merged into the matrix element.

  2. Support Staff 2 Posted by Feodor Fitsner on 16 Apr, 2021 06:00 PM

    Feodor Fitsner's Avatar
  3. 3 Posted by ahigginscassidy on 16 Apr, 2021 06:44 PM

    ahigginscassidy's Avatar

    Thanks for the reply!
    I see, you can't select a column or row of the matrix, you must select a cell.

    I suggest adding such selections as a feature: I have some configuration I'd like to replicate for all jobs of a platform, some common configuration, and some cell configuration. It would make generating configuration much easier.

    For now I'll move it into a bash script.

  4. Support Staff 4 Posted by Feodor Fitsner on 18 Apr, 2021 08:10 PM

    Feodor Fitsner's Avatar

    Thanks for the update! Honestly, sometimes script is the best way.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac