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

LPS-107202 Update liferay-npm-scripts to v19.0.2 #83439

Conversation

wincent
Copy link

@wincent wincent commented Jan 17, 2020

Replacement for #83438 (fixes tests).

TL;DR

  • Babel is now configured to assume React by default, enabling us to delete a few dozen config files.
  • We now use ".babelrc.js" instead of ".babelrc" files, which means we can lint/format them.

From commit 36cf902:

The new version switches our Babel default config over to assume React, enabling us to eliminate a bunch of duplicative config. The new version of liferay-npm-scripts also includes lints to make sure that:

  • The default presets are not redundantly specified in config files.
  • Config files use JS-based formats that we can easily lint (eg. ".babelrc.js", ".eslintrc.js" etc) instead of others (eg. ".eslintrc" etc).

There are two projects where we have to suppress the React preset because their use of incremental-dom is incompatible. Those are dynamic-data-mapping-form-web and dynamic-data-mapping-form-builder. Once we migrate those projects off of incremental-dom, we can remove those config files entirely.

Note that both of these have been ported from ".babelrc" (JSON) to ".babelrc.js" so that the aforementioned lints can apply; as such, we get formatting for free too.

Originally tested here: wincent#120

This file contains nothing not already present in the canonical config
file higher up in the repo, and it is going to cause trouble in the next
commit anyway (because it adds a lint forcing the use of
".prettierrc.js" instead of ".prettierrc"), so let's just delete it.
The new version switches our Babel default config over to assume React,
enabling us to eliminate a bunch of duplicative config. The new version
of liferay-npm-scripts also includes lints to make sure that:

- The default presets are not redundantly specified in config files.
- Config files use JS-based formats that we can easily lint (eg.
  ".babelrc.js", ".eslintrc.js" etc) instead of others (eg. ".eslintrc"
  etc).

There are two projects where we have to suppress the React preset
because their use of incremental-dom is incompatible. Those are
dynamic-data-mapping-form-web and dynamic-data-mapping-form-builder.
Once we migrate those projects off of incremental-dom, we can remove
those config files entirely.

Note that both of these have been ported from ".babelrc" (JSON) to
".babelrc.js" so that the aforementioned lints can apply; as such, we
get formatting for free too.
@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering "ci:test:sf" and "ci:test:relevant" for this pull to run Source Formatter and relevant tests.

Comment "ci:test" to run the full PR Tester for this pull.

@wincent
Copy link
Author

wincent commented Jan 17, 2020

In my local testing, I am seeing a JS test failure in app-builder-web, which is also present on master:

 FAIL  test/js/components/list-view/ListView.es.js
  ● Test suite failed to run

    ReferenceError: themeDisplay is not defined

      19 |
      20 | const EVALUATOR_URL =
    > 21 |      themeDisplay.getPathContext() +
         |      ^
      22 |      '/o/dynamic-data-mapping-form-context-provider/';
      23 |
      24 | let controller = null;

      at Object.themeDisplay (../../dynamic-data-mapping/dynamic-data-mapping-form-renderer/src/main/resources/META-INF/resources/js/util/evaluation.es.js:21:2)

That one is already being tracked in LPS-107247.

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 3 minutes 44 seconds 128 ms

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 726fc07ef6e4aa3aed64a2bdd0160812c5c421dd

Sender Branch:

Branch Name: wincent/LPS-107202/liferay-npm-scripts-v19
Branch GIT ID: ec5ad85c4146b1e9f4a36c2a8f8462635ca7b5ea

1 out of 1jobs PASSED
1 Successful Jobs:
For more details click here.

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:stable - 7 out of 9 jobs passed

❌ ci:test:relevant - 102 out of 114 jobs passed in 1 hour 56 minutes 44 seconds 408 ms

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 726fc07ef6e4aa3aed64a2bdd0160812c5c421dd

Copied in Private Modules Branch:

Branch Name: master-private
Branch GIT ID: 5d51960831c27f3243f2f34f230cdcc64f4b5233

ci:test:stable - 7 out of 9 jobs PASSED
7 Successful Jobs:
ci:test:relevant - 102 out of 114 jobs PASSED

12 Failed Jobs:

102 Successful Jobs:
For more details click here.

Failures unique to this pull:

  1. test-portal-acceptance-pullrequest-batch(master)/js-unit-jdk8
    Job Results:

    1366 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #353644
      1. Liferay_Search_SearchBar _getKeywords.returns the keywords
        timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
        
  2. test-portal-acceptance-pullrequest-batch(master)/modules-unit-project-templates-jdk8
    Job Results:

    210 Tests Passed.
    1 Test Failed.

    1. AXIS_VARIABLE=0,label_exp=!master #220838
      1. ProjectTemplateFilesTest.testProjectTemplateFiles
        org.junit.ComparisonFailure: Forbidden leading or trailing whitespaces in ../project-templates-npm-vuejs-portlet/src/main/resources/archetype-resources/.babelrc.js expected:<...presets": ["env"]
        };[]> but was:<...presets": ["env"]
        };[
        ]>
        	at org.junit.Assert.assertEquals(Assert.java:115)
        	at com.liferay.project.templates.ProjectTemplateFilesTest._testTextFile(ProjectTemplateFilesTest.java:926)
        	at com.liferay.project.templates.ProjectTemplateFilesTest._testTextFile(ProjectTemplateFilesTest.java:951)
        	at com.liferay.project.templates.ProjectTemplateFilesTest.access$400(ProjectTemplateFilesTest.java:70)
        	at com.liferay.project.templates.ProjectTemplateFilesTest$1.visitFile(ProjectTemplateFilesTest.java:895)
        	at com.liferay.project.templates.ProjectTemplateFilesTest$1.visitFile(ProjectTemplateFilesTest.java:840)
        	at java.nio.file.Files.walkFileTree(Files.java:2670)
        	at java.nio.file.Files.walkFileTree(Files.java:2742)
        	at com.liferay.project.templates.ProjectTemplateFilesTest._testProjectTemplateFiles(ProjectTemplateFilesTest.java:838)
        	at com.liferay.project.templates.ProjectTemplateFilesTest.testProjectTemplateFiles(ProjectTemplateFilesTest.java:84)
        	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        	at java.lang.reflect.Method.invoke(Method.java:498)
        	at org.junit.runners.model.FrameworkMeth...

@brianchandotcom
Copy link
Owner

Merged. Thx.

@wincent wincent deleted the wincent/LPS-107202/liferay-npm-scripts-v19 branch January 17, 2020 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants