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

LPD-49303 Update test to use React 18 #4770

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

antonio-ortega
Copy link
Collaborator

Hi,

In this pull request we are removing USE_REACT_16=true flag from our jest tests. There were six modules using this flag:

  • In frontend-js-components-web and frontend-js-state-web there were no failing test after removing the flag, so no further actions were needed.
  • In frontend-data-set-web and frontend-js-spa-web there were some failing tests, so they need to be updated. In the case of test appends existing temporary styles with id in the same place as the reference we realized it can't be done in Jest since it's not compatible with jsdom16. We decided to move it to Playwright, and in order to test it we need a SampleTopHeadPreDynamicInclude to add some <style> to the head of both pages used in this test.
  • In frontend-js-a11y-web and frontend-js-walkthrough-web there were some failing tests, however we've decided to remove those tests since this funcionalities are no longer maintained, and in the case of a11y-web is just a tool for developers.

Thanks.

@liferay-continuous-integration
Copy link
Collaborator

CI is automatically triggering the following test suites:

  •     ci:test:sf

@antonio-ortega
Copy link
Collaborator Author

ci:test:sf

@antonio-ortega
Copy link
Collaborator Author

ci:test:relevant

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:sf - 0 out of 1 jobs passed in 6 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: a3eeae509ec5c5299f93d233cf94f3f2e7b64129

Sender Branch:

Branch Name: LPD-49303
Branch GIT ID: 309558bee37fce96d7a45c9ffdcc342561af8f1a

0 out of 1jobs PASSED
For more details click here.
format-source-files:
     [java] java.lang.Exception: Found 1 formatting issues:
     [java] 1: ./modules/apps/frontend-taglib/frontend-taglib-sample-web/src/main/java/com/liferay/frontend/taglib/sample/web/internal/servlet/taglib/SampleTopHeadPreJSPDynamicInclude.java expected:<...pyrightText: (c) 202[5] Liferay, Inc. https...> but was:<...pyrightText: (c) 202[4] Liferay, Inc. https...>
     [java] 
     [java]   at com.liferay.source.formatter.SourceFormatter.format(SourceFormatter.java:472)
     [java]   at com.liferay.source.formatter.SourceFormatter.main(SourceFormatter.java:301)
[stopwatch] [run.batch.test.action: 3:08.277 sec]
     [echo] The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:498: The following error occurred while executing this line:
     [echo] /opt/dev/projects/github/liferay-portal/portal-impl/build.xml:651: Java returned: 1
  [typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
  [taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.
   [delete] Deleting: /opt/dev/projects/github/liferay-portal/null224161558.properties

merge-test-results:
[mkdir] Created dir: /opt/dev/projects/github/liferay-portal/test-results
[beanshell] Truncating errors in /opt/dev/projects/github/liferay-portal/portal-impl/test-results/TEST-JenkinsLogAssertTest.xml
[junitreport] Processing /opt/dev/projects/github/liferay-portal/test-results/TESTS-TestSuites.xml to /tmp/null1147126646
[junitreport] Loading stylesheet ile:/opt/java/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-frames.xsl
[junitreport] Transform time: 386ms
[junitreport] Deleting: /tmp/null1147126646
[echo] A report with all the test results can be found at test-results/html/index.html.
[mkdir] Created dir: /opt/dev/projects/github/liferay-jenkins-ee/test-results
[copy] Copying 1 file to /opt/dev/projects/github/liferay-jenkins-ee/test-results
[echo] run.batch.test.tear.down.start.timestamp: 02-28-2025 02:13:41:297 PST
[stopwatch] [run.batch.test.tear.down: 0.000 sec]
[typedef] Could not load definitions from resource org/apache/maven/artifact/ant/antlib.xml. It could not be found.
[taskdef] Could not load definitions from resource org/jacoco/ant/antlib.xml. It could not be found.

@antonio-ortega
Copy link
Collaborator Author

ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

@liferay-continuous-integration
Copy link
Collaborator

❌ ci:test:sf - 0 out of 1 jobs passed in 7 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: a3eeae509ec5c5299f93d233cf94f3f2e7b64129

Sender Branch:

Branch Name: LPD-49303
Branch GIT ID: 9f7d7f8a2239aa4b25689136c715ee2819209c95

0 out of 1jobs PASSED
For more details click here.
     [exec] > Task :packageRunCheckFormat
     [exec] yarn run v1.13.0
     [exec] \$ node-scripts check:ci
     [exec] 
     [exec] ?????? Running preflight checks...
     [exec] 
     [exec] ?????? Checking outdated tsconfig.json files ...
     [exec] 
     [exec] ?????? Running TypeScript checks on modified files...
     [exec] ?????? A total of 8 CPUs were detected: launching tsc using 8 workers
     [exec] ??? Checked apps/frontend-js/frontend-js-state-web
     [exec] ??? Checked apps/frontend-js/frontend-js-walkthrough-web
     [exec] ??? Checked apps/frontend-js/frontend-js-spa-web
     [exec] ??? Checked apps/frontend-js/frontend-js-a11y-web
     [exec] ??? Checked apps/frontend-js/frontend-js-components-web
     [exec] ??? Checked apps/frontend-data-set/frontend-data-set-web
     [exec] 
     [exec] ?????? Running format checks on modified files...
     [exec]    /opt/dev/projects/github/liferay-portal/modules/test/playwright/tests/frontend-js-spa-web/navigate.spec.ts
     [exec]      37:9  error  'secondLayout' is assigned a value but never used. Allowed unused vars must match /^_/u.  @typescript-eslint/no-unused-vars
     [exec]    
     [exec]    ??? 1 problem (1 error, 0 warnings)
     [exec]    
     [exec]    
     [exec] ??? CI checks failed.
     [exec] error Command failed with exit code 1.
     [exec] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
     [exec] 
     [exec] > Task :packageRunCheckFormat FAILED
     [exec] 
     [exec] 
     [exec] FAILURE: Build failed with an exception.
     [exec] 
     [exec] * What went wrong:
     [exec] Execution failed for task ':packageRunCheckFormat'.
     [exec] > Process 'command '/opt/dev/projects/github/liferay-portal/build/node/bin/node'' finished with non-zero exit value 1
     [exec] 
     [exec] * Try:
     [exec] > Run with --info or --debug option to get more log output.
     [exec] > Run with --scan to get full insights.
     [exec] > Get more help at https://help.gradle.org.
     [exec] 
     [exec] * Exception is:
     [exec] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':packageRunCheckFormat'.
     [exec]   at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda\$executeIfValid\$1(ExecuteActionsTaskExecuter.java:148)
     [exec]   at org.gradle.internal.Try\$Failure.ifSuccessfulOrElse(Try.java:282)

@liferay-continuous-integration
Copy link
Collaborator

@antonio-ortega
Copy link
Collaborator Author

ci:test:sf

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:sf - 1 out of 1 jobs passed in 7 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: a3eeae509ec5c5299f93d233cf94f3f2e7b64129

Sender Branch:

Branch Name: LPD-49303
Branch GIT ID: bce697e921b41eb787bc7ba18cf6652c1619e1bd

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

@liferay-continuous-integration
Copy link
Collaborator

@antonio-ortega
Copy link
Collaborator Author

ci:test:relevant

@liferay-continuous-integration
Copy link
Collaborator

✔️ ci:test:stable - 24 out of 24 jobs passed

❌ ci:test:relevant - 31 out of 34 jobs passed in 1 hour 7 minutes

Click here for more details.

Base Branch:

Branch Name: master
Branch GIT ID: 8ac9b6c56f56b6f3222ee196435d8d27932ef50a

Upstream Comparison:

Branch GIT ID: 8ac9b6c56f56b6f3222ee196435d8d27932ef50a
Jenkins Build URL: EE Development Acceptance (master) - 1214 - 2025-03-05[16:35:47]

ci:test:stable - 24 out of 24 jobs PASSED
24 Successful Jobs:
    ci:test:relevant - 31 out of 34 jobs PASSED

    3 Failed Jobs:

    31 Successful Jobs:
      For more details click here.

      Failures unique to this pull:


      Failures in common with acceptance upstream results at 8ac9b6c:
      Test bundle downloads:

      @liferay-continuous-integration
      Copy link
      Collaborator

      @liferay-continuous-integration
      Copy link
      Collaborator

      ✔️ ci:test:stable - 24 out of 24 jobs passed

      ❌ ci:test:relevant - 31 out of 34 jobs passed in 1 hour 3 minutes

      Click here for more details.

      Base Branch:

      Branch Name: master
      Branch GIT ID: 8ac9b6c56f56b6f3222ee196435d8d27932ef50a

      Upstream Comparison:

      Branch GIT ID: 8ac9b6c56f56b6f3222ee196435d8d27932ef50a
      Jenkins Build URL: EE Development Acceptance (master) - 1214 - 2025-03-05[16:35:47]

      ci:test:stable - 24 out of 24 jobs PASSED
      24 Successful Jobs:
        ci:test:relevant - 31 out of 34 jobs PASSED

        3 Failed Jobs:

        31 Successful Jobs:
          For more details click here.

          Failures unique to this pull:


          Failures in common with acceptance upstream results at 8ac9b6c:
          Test bundle downloads:

          @liferay-continuous-integration
          Copy link
          Collaborator

          @antonio-ortega
          Copy link
          Collaborator Author

          ci:test:relevant

          @liferay-continuous-integration
          Copy link
          Collaborator

          ✔️ ci:test:stable - 24 out of 24 jobs passed

          ❌ ci:test:relevant - 31 out of 34 jobs passed in 1 hour 23 minutes

          Click here for more details.

          This pull is eligible for reevaluation. When this upstream build has completed, using the following CI command will compare this pull request result against a more recent upstream result:

          ci:reevaluate:1367401_7446

          Base Branch:

          Branch Name: master
          Branch GIT ID: 8aba45b0f950ea58eb21d6054d75a64394c81065

          Upstream Comparison:

          Branch GIT ID: 8ac9b6c56f56b6f3222ee196435d8d27932ef50a
          Jenkins Build URL: EE Development Acceptance (master) - 1214 - 2025-03-05[16:35:47]

          ci:test:stable - 24 out of 24 jobs PASSED
          24 Successful Jobs:
            ci:test:relevant - 31 out of 34 jobs PASSED

            3 Failed Jobs:

            31 Successful Jobs:
              For more details click here.

              Failures unique to this pull:


              Failures in common with acceptance upstream results at 8ac9b6c:
              Test bundle downloads:

              @liferay-continuous-integration
              Copy link
              Collaborator

              Comment on lines 1135 to 1137
              it('navigates when clicking on routed links', async () => {
              this.app = new App();
              this.app.addRoutes(new Route('/path', Screen));
              this.app.addRoutes(new Route('/pathote', Screen));
              Copy link

              Choose a reason for hiding this comment

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

              I noticed this typo with /pathote and I didn't look too far into this (super unfamiliar with all this SPA stuff), but it was concerning how this was still passing. And it seems like simply having expect(this.app.navigationStrategy).toBe('immediate'); without any of the route setup/clicking will pass anyway so I'm not sure this is testing anything?

              I could just be not understanding, but wanted to at least point it out.

              Copy link
              Collaborator Author

              Choose a reason for hiding this comment

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

              Thanks a lot, @thektan ! It's just a typo I was missing.

              @antonio-ortega
              Copy link
              Collaborator Author

              ci:test:sf

              @liferay-continuous-integration
              Copy link
              Collaborator

              ❌ ci:test:sf - 0 out of 1 jobs passed in 4 minutes

              Click here for more details.

              Base Branch:

              Branch Name: master
              Branch GIT ID: cc1194f2a7d673b85c9d0b7f187b3f93b40bfc4c

              Sender Branch:

              Branch Name: LPD-49303
              Branch GIT ID: 138feea36160aad439803b0c1627cc0850d962a2

              0 out of 1jobs PASSED
              For more details click here.
                   [exec] > Task :packageRunCheckFormat
                   [exec] yarn run v1.13.0
                   [exec] \$ node-scripts check:ci
                   [exec] 
                   [exec] ⚙️ Running preflight checks...
                   [exec] 
                   [exec] ⚙️ Checking outdated tsconfig.json files ...
                   [exec] 
                   [exec] ⚙️ Running TypeScript checks on modified files...
                   [exec] ℹ️ A total of 12 CPUs were detected: launching tsc using 12 workers
                   [exec] ✅ Checked apps/frontend-js/frontend-js-state-web
                   [exec] ✅ Checked apps/frontend-js/frontend-js-spa-web
                   [exec] ✅ Checked apps/frontend-js/frontend-js-walkthrough-web
                   [exec] ✅ Checked apps/frontend-js/frontend-js-a11y-web
                   [exec] ✅ Checked apps/frontend-js/frontend-js-components-web
                   [exec] ✅ Checked apps/frontend-data-set/frontend-data-set-web
                   [exec] 
                   [exec] ⚙️ Running format checks on modified files...
                   [exec] 
                   [exec] Done in 15.13s.
                   [exec] 
                   [exec] > Task :portalYarnCheckFormat
                   [exec] Gradle build finished at 2025-03-07 08:18:57.121.
                   [exec] 
                   [exec] BUILD SUCCESSFUL in 23s
                   [exec] 3 actionable tasks: 3 executed
                   [exec] 
                   [exec] See the profiling report at: file:///opt/dev/projects/github/liferay-portal/build/reports/profile/profile-2025-03-07-00-18-36.html
                   [exec] A fine-grained performance profile is available: use the --scan option.
              [beanshell] Executing Gradle task: packageRunCheckFormat
                   [exec] To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.5/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
                   [exec] Daemon will be stopped at the end of the build 
                   [exec] > Task :downloadNode
                   [exec] 
                   [exec] > Task :npmInstall
                   [exec] npm WARN config production Use `--omit=dev` instead.
                   [exec] 
                   [exec] added 130 packages, and audited 134 packages in 1s
                   [exec] 
                   [exec] 23 packages are looking for funding
                   [exec]   run `npm fund` for details
                   [exec] 
                   [exec] found 0 vulnerabilities
                   [exec] 
                   [exec] > Task :packageRunCheckFormat
                   [exec] npm WARN config production Use `--omit=dev` instead.
                   [exec] 
                   [exec] > @liferay/[email protected] checkFormat
                   [exec] > tsc
                   [exec] 
                   [exec] ../../global.d.ts(69,23): error TS2304: Cannot find name 'LiferayEvent'.
                   [exec] ../../global.d.ts(74,23): error TS2304: Cannot find name 'LiferayEvent'.
                   [exec] 

              @liferay-continuous-integration
              Copy link
              Collaborator

              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.

              3 participants