Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps pipeline fails - appears related to Node version #3339

Open
davidfordaus opened this issue Sep 13, 2024 · 0 comments
Open

Azure DevOps pipeline fails - appears related to Node version #3339

davidfordaus opened this issue Sep 13, 2024 · 0 comments

Comments

@davidfordaus
Copy link

davidfordaus commented Sep 13, 2024

When running the following example:
https://github.com/artilleryio/artillery/blob/main/examples/cicd/azure-devops/azure-pipelines.yml

Version info:

2.0.20

Running this command:

Run the pipeline within Azure DevOps above with the example file provided

I expected to see this happen:

  • Success / pipeline runs correctly

Instead, this happened:

==============================================================================
Task : Command line
Description : Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
Version : 2.244.3
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/command-line

Generating script.
Script contents:
artillery run tests/performance/socket-io.yml
========================== Starting Command Output ===========================
/usr/bin/bash --noprofile --norc /home/vsts/work/_temp/96570284-a41e-4827-a70b-75a84145ac56.sh
/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/artillery/node_modules/@oclif/core/lib/command.js:45
delete this.baseFlags?.json;
^

SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/opt/hostedtoolcache/node/12.22.12/x64/lib/node_modules/artillery/node_modules/@oclif/core/lib/index.js:4:19)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Files being used:

https://github.com/artilleryio/artillery/blob/main/examples/cicd/azure-devops/azure-pipelines.yml

This file references node v12. Optional chaining (A JavaScript language feature) as above wasn't introduced until Node v14.

The primary issue is locking the Node version at 12 while permitting the Artillery version to be @latest so the Node and Artillery versions can get out of sync

Suggestions:

  • I'd suggest updating the Node install section of the Pipeline YML file
  • Synchronise the documentation with the code; in general public documentation should be updated as the code / examples are updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant