FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: mention case-insensitive env on windows by oliversalzburg · Pull Request #9166 · nodejs/node · GitHub

/ node Public

doc: mention case-insensitive env on windows - #9166

Closed
oliversalzburg wants to merge 2 commits into
nodejs:masterfrom
oliversalzburg:feature/env-case
Closed

doc: mention case-insensitive env on windows#9166
oliversalzburg wants to merge 2 commits into
nodejs:masterfrom
oliversalzburg:feature/env-case

Conversation

oliversalzburg commented Oct 18, 2016
edited
Loading

Copy link
Copy Markdown
Contributor
Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

doc

Description of change

On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another.

Closes #9157

nodejs-github-bot added doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. labels Oct 18, 2016

oliversalzburg commented Oct 18, 2016
edited
Loading

Copy link
Copy Markdown
Contributor Author

Building Node fails on my system, so I'm currently unable to run the tests :(

This is the output I get during the build: https://gist.github.com/oliversalzburg/592885b45dbf0a561147faef519b0b05

addaleax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Building Node fails on my system, so I'm currently unable to run the tests :(

You can just use your system node to run this particular test, like node test/parallel/test-process-env.js.

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think our linter doesn’t like files that don’t end in newlines

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I think you’ll need to change require('../common'); to const common = require('../common'); for this to work

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Copy link
Copy Markdown
Contributor Author

@addaleax My system node says it's fine:

$ node test/parallel/test-process-env.js; echo $?
0

…unless I'm not doing it right.

addaleax added the test Issues and PRs related to the tests. label Oct 18, 2016

Copy link
Copy Markdown
Member

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you please capitalize and punctuate the comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Gladly, I just wanted to conform with other comments in the file. Is there some guideline regarding capitalization here?

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Can you replace this with two separate assertions:

assert.strictEqual(process.env.TEST, 'test');
assert.strictEqual(process.env.teST, 'test');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Instead of checking the typeof, can you just directly compare against undefined.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actually, you can move the test for process.env.TEST out of the if.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I updated the assertions. Please let me know if that's in line with what you had in mind.

Copy link
Copy Markdown
Member

This is the output I get during the build: https://gist.github.com/oliversalzburg/592885b45dbf0a561147faef519b0b05

Yeah that seems like something for @nodejs/platform-windows to look at

seishun commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

This is the output I get during the build: https://gist.github.com/oliversalzburg/592885b45dbf0a561147faef519b0b05

Since it doesn't pertain to the PR, I suggest moving this discussion to #node-dev.

bzoz commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

Tested master, it compiles fine. I would suggest git clean -fdx

Comment thread test/parallel/test-process-env.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: can you please swap the arguments? The first one is actual and second one expected.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Good call! Done.

Comment thread doc/api/process.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Minor nit: Remove the Note that, and just make it On Windows, environment variables are case-insensitive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Should be fixed now. Thanks

On Windows OS, environment variables are case-insensitive and are treated
likewise in NodeJS. This can be confusing and can lead to hard-to-debug
problems when moving code from one environment to another.

Fixes: #9157
Environment variables should be treated case-insensitive on Windows
platforms and case-sensitive on UNIX platforms

Copy link
Copy Markdown
Member

https://ci.nodejs.org/job/node-test-pull-request/4658/

If no one objects I'll land this if green.

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member

Landed in 2a45616 and 0a8d0ea

Cheers.

benjamingr closed this Oct 25, 2016
benjamingr pushed a commit that referenced this pull request Oct 25, 2016
On Windows OS, environment variables are case-insensitive and are
treated likewise in NodeJS. This can be confusing and can lead
to hard-to-debug problems when moving code from one environment
to another.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
benjamingr pushed a commit that referenced this pull request Oct 25, 2016
Environment variables should be treated case-insensitive on Windows
platforms and case-sensitive on UNIX platforms.

This commit ensures this behavior persists.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
oliversalzburg deleted the feature/env-case branch October 25, 2016 09:28
evanlucas pushed a commit that referenced this pull request Nov 2, 2016
On Windows OS, environment variables are case-insensitive and are
treated likewise in NodeJS. This can be confusing and can lead
to hard-to-debug problems when moving code from one environment
to another.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
evanlucas pushed a commit that referenced this pull request Nov 2, 2016
Environment variables should be treated case-insensitive on Windows
platforms and case-sensitive on UNIX platforms.

This commit ensures this behavior persists.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
Environment variables should be treated case-insensitive on Windows
platforms and case-sensitive on UNIX platforms.

This commit ensures this behavior persists.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
MylesBorins pushed a commit that referenced this pull request Nov 17, 2016
On Windows OS, environment variables are case-insensitive and are
treated likewise in NodeJS. This can be confusing and can lead
to hard-to-debug problems when moving code from one environment
to another.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
MylesBorins pushed a commit that referenced this pull request Nov 19, 2016
Environment variables should be treated case-insensitive on Windows
platforms and case-sensitive on UNIX platforms.

This commit ensures this behavior persists.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
MylesBorins pushed a commit that referenced this pull request Nov 19, 2016
On Windows OS, environment variables are case-insensitive and are
treated likewise in NodeJS. This can be confusing and can lead
to hard-to-debug problems when moving code from one environment
to another.

Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: #9166
Fixes: #9157
MylesBorins mentioned this pull request Nov 22, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Issues and PRs related to the documentations. process Issues and PRs related to the process subsystem. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mention case-insensitivity in process.env docs

10 participants


Back | FazBrowse Home | New Git URL