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

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

Merged
merged 2 commits into from
Dec 28, 2023

Conversation

echoix
Copy link
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
Copy link
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
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
6 checks passed
@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.

None yet

2 participants