question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

update profile configuration file

See original GitHub issue

Current cucumber.js file

var common = [
  '--compiler js:babel-register',
  '--format progress',
  '--format rerun:@rerun.txt',
  '--format usage:usage.txt'
].join(' ')

module.exports = {
  'default': common,
  'node-4': common + ' --tags "not @node-6"',
};

Suggested update new cucumber.yml file (using references)

_common: &COMMON
  compiler: js:babel-register
  format:
    - progress
    - rerun:@rerun.txt
    - usage:usage.txt

default:
  <<: *COMMON

node-4:
  <<: *COMMON
  tags: not @node-6

@jbpros thoughts? We originally went with .js in order to avoid the clash with ruby’s cucumber.yml but I don’t see think thats as an issue. Aside from this project when I first joined, I’ve never seen a project that used both cucumber-ruby and cucumber-js. Nor can I think of a valid reason to do so.

@mattwynne you as well as you may be able to get rid of the erb support.

Mainly would like to allow users to not have put actual CLI options in here. The options mirror the long form of the CLI options but without the need of actually specifying them with all the --. Implementation wise you can still convert these to cli options pretty easily (on the javascript side the there is a javascript library for doing that: dargs.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
davidjgosscommented, Jul 4, 2021

@aslakhellesoy sounds good, I’ll try and do this in conjunction with #1711.

I think it would make sense to keep this new thing separate from the existing cucumber.js file which would then become deprecated. It’d be good to move away from default as a key on module.exports - it’s thrown up some issues when trying to switch to loading with await import() in #1649 (I’m now descoping the config file from that change).

On the naming of the files, what do we think about the unix-esque convention used by mocha, eslint etc:

.cucumberrc.json
.cucumberrc.yml
.cucumberrc.js
0reactions
davidjgosscommented, Sep 30, 2021

Looking at this now as part of #1711, one thing I’d like to review about how config works today with the CLI and Profiles is the additive nature of it.

In other words, if you have a config file like:

// cucumber.js
module.exports = {
  default: 'my/features/dir/*.feature'
}

And then run:

$ npx cucumber-js my/features/dir/specific-thing.feature

It will concatenate the arguments rather than override. In this specific case, it’s a problem because it stops you from narrowing the sources. With other things like formats, it’s sometimes a strength - your default config can define a bunch of formatters, but you can specify others as needed via the CLI and/or other profiles. You can also invoke multiple profiles, and it all kind of gets layered on.

Some things we could do:

  • Keep it this way
  • Make it so that anything passed to the CLI will override the file-based config - this is more consistent with how config works in other things e.g. Jest, ESLint - and config from multiple profiles would still be combined to give the composability.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and edit configuration profiles in Apple Configurator
Edit a configuration profile. In Apple Configurator , choose File > Open, then locate the configuration profile on your Mac. If the configuration...
Read more >
Create or edit Configuration Profiles for iOS, macOS, or tvOS
The configuration profile file that you created is now ready for use on an iOS, macOS, or tvOS device. You can install it...
Read more >
Updating a System Configuration Profile
Use the installadm update-profile command to replace the specified profile from the specified install service with the contents of the named file.
Read more >
update-configuration-profile — AWS CLI 2.9.6 Command ...
Use a specific profile from your credential file. --region (string). The region to use. Overrides config/env settings. --version ( ...
Read more >
19.12. Editing a Profile's Configuration Files
Select the profile from which you want to edit config files. The Profiles page for the selected profile opens. Locate the config file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found