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

Migration guide stuck to #1542

Closed
VincentCATILLON opened this issue Jul 19, 2019 · 5 comments
Closed

Migration guide stuck to #1542

VincentCATILLON opened this issue Jul 19, 2019 · 5 comments

Comments

@VincentCATILLON
Copy link

Migration guide is currently stuck to 12.7.0 whereas the last release is 13.2.0 and (following semver) introduces breaking changes.

For my own, I updated to the 13.1 (and before, to 12.11 too) and I got timeout (with xxx is not defined after init) with an app launching but closing immediatly.

Can you please update your documentation ?


Jest: 14.x
RN: 0.59.8
Detox: 13.1

My package.json:

{
  "scripts": {
    "start:e2e": "REACT_NATIVE_FLAVOR=E2E npm run -s start:clean",
    "build:ios:cmd": "cd ios && export RCT_NO_LAUNCH_PACKAGER=1 && xcodebuild -workspace Coorpacademy.xcworkspace -scheme Coorpacademy -derivedDataPath build",
    "build:iphonesimulator:debug": "REACT_NATIVE_FLAVOR=E2E npm run build:ios:cmd -- -configuration Debug -sdk iphonesimulator | xcpretty",
    "prebuild:iphonesimulator:release": "REACT_NATIVE_FLAVOR=E2E npm run -s generate:bundle:ios",
    "build:iphonesimulator:release": "REACT_NATIVE_FLAVOR=E2E npm run build:ios:cmd -- -configuration Release -sdk iphonesimulator | xcpretty",
    "build:androidemulator:debug": "cd android && export REACT_NATIVE_FLAVOR=E2E && ./gradlew assembleDebug assembleAndroidTest  -DtestBuildType=debug && cd ..",
    "build:androidemulator:release": "cd android && export REACT_NATIVE_FLAVOR=E2E && ./gradlew assembleRelease assembleAndroidTest  -DtestBuildType=release && cd ..",
    "test:end2end:ios:debug": "npm run test:end2end:ios:debug:build && npm run test:end2end:ios:debug:test",
    "test:end2end:ios:debug:build": "detox build --configuration=ios.simulator.debug",
    "test:end2end:ios:debug:test": "detox test --configuration=ios.simulator.debug",
    "test:end2end:ios:release": "npm run test:end2end:ios:release:build && npm run test:end2end:ios:release:test",
    "test:end2end:ios:release:build": "detox build --configuration=ios.simulator.release",
    "test:end2end:ios:release:test": "detox test --configuration=ios.simulator.release",
    "test:end2end:android:debug": "npm run test:end2end:android:debug:build && npm run test:end2end:android:debug:test",
    "test:end2end:android:debug:build": "detox build --configuration=android.emulator.debug",
    "test:end2end:android:debug:test": "detox test --configuration=android.emulator.debug",
    "test:end2end:android:release": "npm run test:end2end:android:release:build && npm run test:end2end:android:release:test",
    "test:end2end:android:release:build": "detox build --configuration=android.emulator.release",
    "test:end2end:android:release:test": "detox test --configuration=android.emulator.release",
  },
  "detox": {
    "test-runner": "jest",
    "runner-config": "jest.config.e2e.js",
    "configurations": {
      "ios.simulator.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/Coorpacademy.app",
        "build": "npm run build:iphonesimulator:debug",
        "type": "ios.simulator",
        "name": "iPhone 6"
      },
      "ios.simulator.release": {
        "binaryPath": "ios/build/Build/Products/Release-iphonesimulator/Coorpacademy.app",
        "build": "npm run build:iphonesimulator:release",
        "type": "ios.simulator",
        "name": "iPhone 6"
      },
      "android.emulator.debug": {
        "binaryPath": "android/app/build/outputs/apk/debug/Coorpacademy-debug.apk",
        "build": "npm run build:androidemulator:debug",
        "type": "android.emulator",
        "name": "Nexus_5X_API_19"
      },
      "android.emulator.release": {
        "binaryPath": "android/app/build/outputs/apk/release/Coorpacademy-release.apk",
        "build": "npm run build:androidemulator:release",
        "type": "android.emulator",
        "name": "Nexus_5X_API_19"
      }
    }
  }
}

My metro config:

/**
 * Metro configuration for React Native
 * https://github.com/facebook/react-native
 *
 * @format
 */
const createBlacklist = require('metro-config/src/defaults/blacklist');

const {REACT_NATIVE_FLAVOR} = process.env;

module.exports = {
  resolver: {
    sourceExts: REACT_NATIVE_FLAVOR === 'E2E' ? ['e2e.js', 'js'] : ['js'],
    blacklistRE: (() => {
      if (REACT_NATIVE_FLAVOR === 'STORYBOOK') {
        // this is to have fixtures embedded in storybook app
        return createBlacklist([]);
      }
    })()
  },
  transformer: {
    getTransformOptions: () => ({
      transform: {
        experimentalImportSupport: false,
        inlineRequires: false
      }
    })
  }
};

My jest config:

module.exports = {
  testEnvironment: 'node',
  moduleFileExtensions: ['unit.js', 'unit.json', 'ios.js', 'android.js', 'js', 'json'],
  setupFilesAfterEnv: ['./__e2e__/init.js'],
  reporters: ['detox/runners/jest/streamlineReporter'],
  bail: true,
  verbose: true
};

And my init file:

import detox from 'detox';
import adapter from 'detox/runners/jest/adapter';
import specReporter from 'detox/runners/jest/specReporter';

import json from '../package';

const config = json.detox;

jest.setTimeout(120000);
// $FlowFixMe jest flow type is incomplete
jasmine.getEnv().addReporter(adapter);
// $FlowFixMe jest flow type is incomplete
jasmine.getEnv().addReporter(specReporter);

beforeAll(async () => {
  await detox.init(config);

  // since we mix jest & detox in our codebase, we cannot use flow
  // with a single config that mix multiples interfaces
  // here is a simple trick to avoid much pain
  // (we force weExpect type to match what we want)
  global.weExpect = expect;
});

beforeEach(async function() {
  await adapter.beforeEach();
});

afterAll(async () => {
  await adapter.afterAll();
  await detox.cleanup();
});

I tried with config.json as jest example does, cleaning and building the detox cache again, cleaning my ios build folder, coming from 10.1 to 10.2.1, reinstall latest applesimutils, nothing changes.

@support
Copy link

support bot commented Jul 19, 2019

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Feel free to post your Stack Overflow question here for more visility. We'll take a look at it.

For more information on bots in this reporsitory, read this discussion.

@support support bot closed this as completed Jul 19, 2019
@LeoNatan
Copy link
Contributor

There shouldn't be steps requiring migration. If you are seeing problems, open a bug report.

@VincentCATILLON
Copy link
Author

VincentCATILLON commented Jul 22, 2019

You made a major release, so following semver, it should introduce API breaking changes. That was my point (in addition to my issues) and documentation or release notes are missing for this

@LeoNatan
Copy link
Contributor

We take semver as guidelines, not strict rules. We also take into account the usage patterns of our users. We consider the potential of major breaking changes (due to internal changes that don't necessarily change the API) as worthy of a major version, so that Detox will most update automatically for most of our users on the whims of an npm install (because they use 12.x.x in their package.json). In the case of Detox 13, as you can see in the release notes here, I changed how a major component works on iOS, and thus I felt it was important to bump the major version so that users don't suddenly get broken tests in case there are issues with typing (there weren't in this case).

@LeoNatan
Copy link
Contributor

For example, once I land #1514, I plan to bump another major version, if the API itself will have no change.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants