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

🐛 fix build-constant isForTesting #35335

Merged
merged 1 commit into from
Jul 21, 2021
Merged

Conversation

samouri
Copy link
Member

@samouri samouri commented Jul 21, 2021

summary
Fixes #35325

I created a bug in local development when merging #34327.
I had assumed isForTesting corresponded to when the flag --fortesting was passed, but really the value should always be true unless amp dist is used without the fortesting flag.

cc @calebcordry

@amp-owners-bot amp-owners-bot bot requested a review from rsimha July 21, 2021 16:06
@samouri samouri self-assigned this Jul 21, 2021
@samouri samouri requested review from rcebulko and calebcordry and removed request for rsimha July 21, 2021 16:07
@@ -18,7 +18,7 @@ const {VERSION} = require('./internal-version');

const testTasks = ['e2e', 'integration', 'visual-diff', 'unit', 'check-types'];
const isTestTask = testTasks.some((task) => argv._.includes(task));
const isForTesting = argv.fortesting || isTestTask;
const isForTesting = argv.fortesting || !argv._.includes('dist');
Copy link
Member

@calebcordry calebcordry Jul 21, 2021

Choose a reason for hiding this comment

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

I'm out of my depth here but will this set getMode().localDev to true or getMode().test to true or both?

Copy link
Member Author

@samouri samouri Jul 21, 2021

Choose a reason for hiding this comment

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

It will allow getMode().localDev to be true. Without fortesting==true, the check early exits.
The naming of the variables is really not helping here.

I think if we flipped the conditions and renamed the variable to IS_FOR_PRODUCTION it would make much more sense.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seeing if it makes it more clear here: #35336

Copy link
Member

Choose a reason for hiding this comment

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

Nice, I think the renaming helps. Thanks Jake.

Copy link
Member

@calebcordry calebcordry left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this so quickly!

@samouri samouri enabled auto-merge (squash) July 21, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛installExtensionForDoc not working in local dev server
5 participants