Skip to content

mega-linter-runner: Improve check if running as script or module#3233

Merged
echoix merged 2 commits intooxsecurity:mainfrom
echoix:runner-args-module
Dec 28, 2023
Merged

mega-linter-runner: Improve check if running as script or module#3233
echoix merged 2 commits intooxsecurity:mainfrom
echoix:runner-args-module

Conversation

@echoix
Copy link
Copy Markdown
Collaborator

@echoix echoix commented Dec 18, 2023

Apparently the check for using the command line arguments to create the MegaLinterRunnerCli() when run as a script wasn’t working correctly since changed to use modules, at least in tests. That meant that all command line arguments (of the test invocation) were passed when the tests for modules was used (since called before), and since the no docker pull option isn’t in the argv of the mocha invocation, it pulled the latest Megalinter docker image (a second one) and started to lint the workspace instead of just doing the tests.

Here, the argv is really only passed when it is called a script and not a module.

Proposed Changes

Readiness Checklist

Author/Contributor

  • Add entry to the CHANGELOG listing the change and linking to the corresponding issue (if appropriate)
  • If documentation is needed for this change, has that been included in this pull request

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, enhancement, infrastructure, or performance

@echoix echoix added the javascript Pull requests that update Javascript code label Dec 18, 2023
@echoix
Copy link
Copy Markdown
Collaborator Author

echoix commented Dec 18, 2023

Since the mega-linter-runner tests at the end of the build and deploy dev workflow doesn’t have to waste time pulling, the time is down to 2min22 seconds for this step, instead of the 6min30 sec that was taken.

In the tests, it’s the v8r linter that seems way too slow (40 secs instead of less than 2 for the other 2 linters)

Copy link
Copy Markdown
Member

@nvuillam nvuillam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems ok :)
Please test with mega-linter-runner@beta before our next release :)

@echoix echoix merged commit 461a6e9 into oxsecurity:main Dec 28, 2023
@echoix echoix deleted the runner-args-module branch December 28, 2023 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants