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.

Allow more truthy values for `CUCUMBER_PUBLISH_ENABLED`

See original GitHub issue

I tried CUCUMBER_PUBLISH_ENABLED=1 and nothing was published. Any value should be considered truthy except /false|no|0/. This is how it’s implemented in Cucumber-Ruby.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
aslakhellesoycommented, Aug 20, 2020

I already did. It’s at the first line in this issue. I’ll elaborate for clarity:

Environment variables were introduced in UNIX in the late seventies, and the way C code and shell scripts behave is that any value of an environment variable resolves to a truthy value. This is because the stdlib getenv function either returns a string (truthy) or NULL (falsy).

This works fine in most cases. If you want falsy, just don’t specify the variable. If you want truthy, specify any value. This means 0, 1, true, false, whatever are all truthy.

This is why I was surprised when 1 was not interpreted as truthy. It deviates from standard UNIX behaviour, and the underlying programming language is irrelevant.

The fact that all values are truthy might not be intuitive to some, but it’s the way environment variables are designed to work. Some tools have adopted conventions that deviate from the original behaviour by interpreting a small set of values as falsey. The most common ones seem to be 0, false and no.

Git for example, interprets 0 and false as falsey. 1 and true as truthy. Any other value is an error. (Try GIT_TRACE=1 git status).

For users who are using the values true and false, this change will not alter the behaviour.

Users who have specified 1 or banana will now get a truthy value instead of a falsey one.

Are you suggesting there are users out there who might have been expecting falsey for 1 and other non-true strings that will now be confused about the new behaviour?

(BTW, I agree we should not attempt to internationalise this).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Share reports and living documentation with the whole team
The free Cucumber reports service makes it simple to share living documentation with all team members, instantly. Powered by Cucumber Messages, ...
Read more >
Error while running cucumber in junit - java - Stack Overflow
i am trying to run a simple cucumber feature test. below are my feature file, step definition file and junit runner file. but...
Read more >
Implementing 'Masterthought' Reports in Cucumber - Dezlearn
Let's learn more about Masterthought reporting plugin in BDD framework. Configuration: 1. First step we need to perform is to add maven ...
Read more >
Cucumber reports - Jenkins Plugins
This plugin allows Jenkins to publish the results as pretty html reports hosted by the Jenkins build server. In order for this plugin...
Read more >
Data Types - Swagger
string (this includes dates and files); number; integer; boolean; array; object. These types exist in most programming languages, ...
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