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.

  5. Feodor Fitsner closed this discussion on 18 Jun, 2021 09:03 PM.

Comments are currently closed for this discussion. You can start a new one.

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

 

01 Oct, 2024 04:27 PM
26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM