How can I disable ESLint from automatically running in WebStorm? - webstorm

I'd like to run ESLint when I save a certain file, and not have WebStorm automatically run ESLint in the background. Is this possible?

Disable ESLint integration in Settings | Languages & Frameworks | JavaScript | Code Quality Tools | ESLint
Set up it as a file watcher in Settings | Tools | File Watchers. see this article for some hints
We have plans to enable running ESLint on save out of the box, please follow WEB-24452 for updates

Related

Methods to automate ColdFusion Administrator settings

When working with a ColdFusion server you can access the CFIDE/administrator to set config values, which update the cfusion/lib/ xml files (e.g. neo-runtime.xml, neo-mail.xml, etc.)
I'd like to automate a deployment process that includes setting these administrator values so that I don't have to log in and manually set them for each new box that shares settings. I'm unsure of the best way to go about it.
Some thoughts I had are:
Replacing the full files with ones containing my custom settings. I've done this for local development, but it may not be an ideal method due to CF hot-fixes potentially adding/removing/changing attributes.
A script to read the wddx xml file and replace the attribute values. I'm having trouble finding information about how to do this method.
Has anyone done anything like this before? Or does anyone have any recommendations on how to best go about this?
At one company, we checked all the neo-*.xml files into source control, with a set for each environment Devs only had access to the dev settings and we could deploy a local development environment with all the correct settings for new employees quickly.
but it may not be an ideal method due to CF hot-fixes potentially adding/removing/changing attributes.
You have to keep up with those changes and migrate each environment appropriately.
While I was there, we upgraded from 8 to 9, 9 to 11 and from 11 to 2016. Environments would have to be mixed as it took time to verify the applications worked with each new version of CF. Each server got their correct XML files for that environment and scripts would copy updates as needed. We had something like 55 servers in production running 8 instances each, so this scaled well.
There is a very usefull tool developed by Ortus Solutions for this kind of automatizations called cfconfig that can be installed with their commandbox command line utility. This tool isn't only capable of setting configurations of the administrator: It is also capable of exporting/importing settings to a json file (cfconfig.json). It might be what you need.
Here is the link to their docs
https://cfconfig.ortusbooks.com/introduction/getting-started-guide
CFConfig worked perfectly for my needs. I marked #AndreasRu answer as accepted for introducing me to that tool! I'm just adding this response with some additional detail for posterity.
Install CommandBox as part of deployment script
Install CFConfig as part of deployment script
Use CFConfig to export a config.json file from an existing box that will share settings with the new deployment. Store this json file in source control for each type/env of box.
Use CFConfig to import the config.json as part of deployment script
Here's a simple example of what this looks like on debian
# Installs CommandBox
curl -fsSl https://downloads.ortussolutions.com/debs/gpg | apt-key add -
echo "deb https://downloads.ortussolutions.com/debs/noarch /" | tee -a /etc/apt/sources.list.d/commandbox.list
apt-get update && apt-get install apt-transport-https commandbox
# Installs CFConfig module
box install commandbox-cfconfig
# Import config settings
box cfconfig import from=/<path-to-config>/config.json to=/opt/ColdFusion/cfusion/ toFormat=adobe#11.0.19

WebStorm open folder in terminal and automatically rename session to folder name

When I open a folder in terminal using right click - Open in Terminal the new Terminal session runs with a default given Tab name Local.
I have more than one apps in my monorepo and when I open them all in Terminals, the bottom Terminal window section looks like this:
Local | Local (1) | Local (2) | Local (3) | Local (4)
It is uncomfortable to first rename all these sessions to the names of the application folders. I found no option in the preferences - Terminal settings.
Is there any chance to configure WebStorm to automatically rename the tabs to the folder names?
there is no such option, please vote for IDEA-146714 to be notified on any progress with it

How to install Cobertura in azure Devops?

I have a .net core whith CI in Azure devops.
After successfully running my unit tests, I would like to generate and display code coverage using ReportGenerator, based on this article:
https://www.meziantou.net/computing-code-coverage-for-a-dotnet-core-project-with-azure-devops-and-coverlet.htm
Part of the YAML:
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.SourcesDirectory)/**Tests/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
displayName: Create Code coverage report
This gives me the folling error:
...line 2: Cobertura: command not found
By removing the Cobertura from reporttypes, there are no errors, but then there are no report to be shown.
How can I install or enable Cobertura?
By removing HtmlInline_AzurePipelines from reporttypes, it worked
This way you are skipping a parameter option. Accordingly to the documentation, you can try to wrap that option with " like in the following:
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.SourcesDirectory)/**Tests/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage "-reporttypes:HtmlInline_AzurePipelines;Cobertura"
displayName: Create Code coverage report
This should probably work as well without skipping it.

Running jest tests directly in Intellij Idea/WebStorm?

I'm using jest to write tests in my ReactJS application.
So far, to run my test suite, I need to type 'npm test'.
Here's the snippet from package.npm:
"scripts": {
"test": "./node_modules/.bin/jest",
(other stuff)
},
"jest": {
"unmockedModulePathPatterns": ["<rootDir>/node_modules/react"],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"testFileExtensions": [
"es6",
"js"
],
"moduleFileExtensions": [
"js",
"json",
"es6"
]
},
Is it possible to run those tests within my IDE (IDEA/WebStorm) directly, preserving the configuration? I'm not a js guy, but for example WebStrom works perfectly fine with Karma. Shouldn't this be possible with jest-cli either?
To make Jest test results shown in a tree view (like karma, etc.), a special integration is needed. WebStorm doesn't yet support Jest. Please vote for WEB-14979 to be notified on any progress.
EDIT: as of March 2017 the first version of Jest integration at WebStorm has been released.
In WebStorm 9+ You can set this up as follows:
Install Jest CLI: npm install --save-dev jest-cli
Create node run configuration with javascript file set to node_modules/.bin/jest, and application parameter to --runInBand. runInBand tells jest to run in single process, otherwise there's a port conflict when running multiple node processes in debug mode
Create some tests and run configuration in Debug mode (Ctrl-D/CMD-D). If you set breakpoints in your test or app code they should hit
It would be great though if you could click on file:line numbers in the output to go directly to the code.
app_sciences's answer is awesome, but does not work for Windows.
For windows, you can use next configuration:
Provided configuration is taken from here
For IDEA I'm using https://confluence.jetbrains.com/display/IDEADEV/Run+Configurations for that purposes. For WebStorm it seems you can add your config by yourself https://www.jetbrains.com/webstorm/help/creating-and-editing-run-debug-configurations.html . The configuration you are talking about is on the software level. If you will configure to run it via your IDE it will definitely will run within the ENV variables and paths given, you just need to add the needed global paths and the commands to run.

How do I integrate acceptance testing for my project on Jenkins?

I am currently working on a UI project for my team. After building a project on Jenkins, we want to trigger acceptance tests to run. On my local machine, I am able to do so by activating a server.py with the command:
python server.py
After the server is up and running, I can run the acceptance test folder that I have written with the command:
pybot acceptance_tests
I am now trying to migrate my tests from my local machine to Jenkins. What I cannot figure out is how I am able to run the server (server.py) on Jenkins. I am relatively new to Jenkins, so any details will be great!
Instead of starting the server via jenkins, have the test start and stop the server. This will give you the same behavior regardless of how you run your tests (ie: via jenkins for manually from the command line).
Robot has a library named Process which you can use for starting and stopping processes. You can use the Start Process and Terminate Process keywords to start and stop the webserver via a suite setup and suite teardown. It would look something like this:
*** Settings ***
| Library | Process
| Suite Setup | Start the webserver
| Suite Teardown | Stop the webserver
*** Keywords ***
| Start the webserver
| | ${server process}= | Start process | python | server.py
| | Set suite variable | ${server process}
| Stop the webserver
| | Terminate Process | ${server process}
Of course, you'll want to add some bullet proofing such as making sure the server actually starts, and possibly catching errors if it doesn't exit cleanly. You may need to give an explicit path to server.py, but hopefully this gives the general idea.