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

Mobile unit tests are failing on Gutenberg CI #1356

Closed
hypest opened this issue Sep 5, 2019 · 5 comments · Fixed by WordPress/gutenberg#18378
Closed

Mobile unit tests are failing on Gutenberg CI #1356

hypest opened this issue Sep 5, 2019 · 5 comments · Fixed by WordPress/gutenberg#18378
Assignees
Labels
Testing Anything related to automated tests

Comments

@hypest
Copy link
Contributor

hypest commented Sep 5, 2019

The JS mobile unit tests are currently failing on the Gutenberg CI with the multiple instances of this error:

FAIL ../../packages/rich-text/src/component/test/index.native.js
  ● Test suite failed to run
    Cannot find module 'Platform' from 'react-native-implementation.js'

    However, Jest was able to find:
    	'../index.js'
    	'../index.native.js'

    You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].

    See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string

      4 | import { StyleSheet, TouchableOpacity, Text, View, Platform } from 'react-native';
      5 | 
    > 6 | const isAndroid = Platform.OS === 'android';
        |                   ^
      7 | const marginBottom = isAndroid ? -0.5 : 0;
      8 | const marginLeft = -3;
      9 | 
      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:229:17)
      at Object.require [as Platform] (node_modules/react-native/Libraries/react-native/react-native-implementation.js:325:12)
      at Object.Platform (packages/components/src/button/index.native.js:6:19)

Example: Travis Job failing, on this PR

The Travis job is set to "This job is allowed to fail." so it doesn't block the PRs but, we need to fix this in order to move to the next steps.

@hypest hypest added the Testing Anything related to automated tests label Sep 5, 2019
@Tug Tug self-assigned this Sep 26, 2019
@hypest
Copy link
Contributor Author

hypest commented Sep 27, 2019

Following up on our weekly hangout yesterday, let's put this ticket back into the "Open Beta" project column and un-assign people from it. We'll get back to it very soon.

@hypest hypest unassigned Tug and marecar3 Sep 27, 2019
@hypest
Copy link
Contributor Author

hypest commented Oct 23, 2019

👋 @JavonDavis , can you have a look when you get the chance? Thanks!

Here's a recent PR that the mobile Jest tests on Gutenberg fail: PR, the Travis job page, and the failing log line in Travis.

@JavonDavis
Copy link
Contributor

@hypest sure I can take a look at this!

@JavonDavis JavonDavis self-assigned this Oct 24, 2019
@hypest
Copy link
Contributor Author

hypest commented Nov 7, 2019

I think I managed to replicate the issue by running the (Gutenberg side) tests on an Ubuntu VM locally. Opened WordPress/gutenberg#18378 in an attempt to fix this.

@JavonDavis
Copy link
Contributor

I think I managed to replicate the issue by running the (Gutenberg side) tests on an Ubuntu VM locally. Opened WordPress/gutenberg#18378 in an attempt to fix this.

Interesting 🤔@hypest thanks for getting to that for me 🙇 I just hadn't gotten a chance to really look into it as yet! I'll give the PR a go 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing Anything related to automated tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants