Commit 395a8308 authored by Vincent Ogloblinsky's avatar Vincent Ogloblinsky Committed by Cédric OLIVIER
Browse files

feat: add Node.js extra opts

parent 7b9a2135
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
# [1.2.1](https://gitlab.com/to-be-continuous/playwright/compare/1.2.0...1.2.1) (2024-2-5)

### Features

* Node.js extra opts ([374514f](https://gitlab.com/to-be-continuous/playwright/commit/6121ab307a39c1703fdf772db6a943e61111bf32))

# [1.2.0](https://gitlab.com/to-be-continuous/playwright/compare/1.1.0...1.2.0) (2024-1-27)


+1 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ It uses the following variable:
| `project-dir` / `PLAYWRIGHT_PROJECT_DIR` | The Playwright root project directory (contains the `playwright.config.ts` file)                                            | `.`                                         |
| `extra-args` / `PLAYWRIGHT_EXTRA_ARGS` | Playwright extra [run options](https://playwright.dev/docs/test-cli)                                                        | _none_                                      |
| `review-enabled` / `REVIEW_ENABLED` | Set to `true` to enable Playwright tests on review environments (dynamic environments instantiated on development branches) | _none_ (disabled)                           |
| `node-install-extra-opts` / `NODE_INSTALL_EXTRA_OPTS` | Extra options to install project dependencies (either [`npm ci`](https://docs.npmjs.com/cli/ci.html/), [`yarn install`](https://yarnpkg.com/cli/install) or [`pnpm install`](https://pnpm.io/cli/install)) | _none_ |

In addition to a textual report in the console, this job produces the following reports, kept for one day:

+5 −0
Original line number Diff line number Diff line
@@ -26,6 +26,11 @@
      "name": "REVIEW_ENABLED",
      "description": "Set to enable Playwright tests on review environments (dynamic environments instantiated on development branches)",
      "type": "boolean"
    },
    {
      "name": "NODE_INSTALL_EXTRA_OPTS",
      "description": "Extra options to install project dependencies",
      "type": "text"
    }
  ]
}
+7 −1
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ spec:
      description: Set to enable Playwright tests on review environments (dynamic environments instantiated on development branches)
      type: boolean
      default: false
    node-install-extra-opts:
      description: Extra options to install project dependencies (either [`npm ci`](https://docs.npmjs.com/cli/ci.html/), [`yarn install`](https://yarnpkg.com/cli/install) or [`pnpm install`](https://pnpm.io/cli/install))
      default: ""

---
workflow:
  rules:
@@ -87,6 +91,8 @@ variables:
  # default integration ref name (pattern)
  INTEG_REF: /^develop$/

  NODE_INSTALL_EXTRA_OPTS: $[[ inputs.node-install-extra-opts ]]

  PLAYWRIGHT_EXTRA_ARGS: $[[ inputs.extra-args ]]
  REVIEW_ENABLED: $[[ inputs.review-enabled ]]

@@ -317,7 +323,7 @@ stages:
    if [[ -f "package-lock.json" ]]
    then
      log_info "\\e[33;1mpackage-lock.json\\e[0m file found: install dependencies..."
      npm ci --cache .npm --prefer-offline
      npm ci --cache .npm --prefer-offline "$NODE_INSTALL_EXTRA_OPTS"
    elif [[ -f "package.json" ]]
    then
      log_warn "\\e[33;1mpackage.json\\e[0m file found but no \\e[33;1mpackage-lock.json\\e[0m: use Playwright with default dependencies"