Title: `$ tns test android` test harness reports "no reachable hosts" · Issue #4182 · NativeScript/nativescript-cli · GitHub
Open Graph Title: `$ tns test android` test harness reports "no reachable hosts" · Issue #4182 · NativeScript/nativescript-cli
X Title: `$ tns test android` test harness reports "no reachable hosts" · Issue #4182 · NativeScript/nativescript-cli
Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 5.0.1 Cross-platform modules: 5.0.5 Android...
Open Graph Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 5.0...
X Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 5.0...
Opengraph URL: https://github.com/NativeScript/nativescript-cli/issues/4182
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`$ tns test android` test harness reports \"no reachable hosts\"","articleBody":"**Environment**\r\nProvide version numbers for the following components (information can be retrieved by running `tns info` in your project folder or by inspecting the `package.json` of the project):\r\n - CLI: 5.0.1\r\n - Cross-platform modules: 5.0.5\r\n - Android Runtime: 5.0.0\r\n - iOS Runtime: 5.0.0\r\n - Plugin(s): None\r\n\r\n**Describe the bug**\r\nI'm trying to set up unit tests in a brand new project and run on an android emulator. When running the steps to reproduce the test harness starts but then reports \"no reachable hosts\" and hangs. The output from the terminal is:\r\n```\r\n$ tns test android\r\nSearching for devices...\r\nStarting Android emulator with image Pixel_2_API_28\r\nWaiting for emulator device initialization...\r\n28 11 2018 19:48:42.468:WARN [karma]: No captured browser, open http://localhost:9876/\r\n28 11 2018 19:48:42.473:INFO [karma-server]: Karma v3.1.1 server started at http://0.0.0.0:9876/\r\n28 11 2018 19:48:42.473:INFO [launcher]: Launching browsers android with concurrency unlimited\r\n28 11 2018 19:48:42.477:INFO [launcher]: Starting browser NativeScript Unit Test Runner\r\nCopying template files...\r\nPlatform android successfully added. v5.0.0\r\nExecuting before-shouldPrepare hook from /Users/drewcain/code/testandroid/hooks/before-shouldPrepare/nativescript-dev-webpack.js\r\nPreparing project...\r\nExecuting before-prepareJSApp hook from /Users/drewcain/code/testandroid/hooks/before-prepareJSApp/nativescript-dev-webpack.js\r\nSuccessfully prepared plugin nativescript-theme-core for android.\r\nSuccessfully prepared plugin nativescript-unit-test-runner for android.\r\nSuccessfully prepared plugin nativescript-vue for android.\r\nSuccessfully prepared plugin tns-core-modules for android.\r\nSuccessfully prepared plugin tns-core-modules-widgets for android.\r\nProject successfully prepared (android)\r\nExecuting after-prepare hook from /Users/drewcain/code/testandroid/hooks/after-prepare/nativescript-dev-webpack.js\r\nExecuting after-prepare hook from /Users/drewcain/code/testandroid/hooks/after-prepare/nativescript-unit-test-runner.js\r\nExecuting before-watchPatterns hook from /Users/drewcain/code/testandroid/hooks/before-watchPatterns/nativescript-dev-webpack.js\r\nExecuting before-watch hook from /Users/drewcain/code/testandroid/hooks/before-watch/nativescript-dev-webpack.js\r\nExecuting before-shouldPrepare hook from /Users/drewcain/code/testandroid/hooks/before-shouldPrepare/nativescript-dev-webpack.js\r\nSkipping prepare.\r\nBuilding project...\r\nGradle build...\r\n + setting applicationId\r\n + applying user-defined configuration from /Users/drewcain/code/testandroid/app/App_Resources/Android/app.gradle\r\nUsing support library version 28.0.0\r\n + adding nativescript runtime package dependency: nativescript-optimized-with-inspector\r\n + adding aar plugin dependency: /Users/drewcain/code/testandroid/node_modules/tns-core-modules-widgets/platforms/android/widgets-release.aar\r\nNote: Some input files use or override a deprecated API.\r\nNote: Recompile with -Xlint:deprecation for details.\r\nProject successfully built.\r\nInstalling on device emulator-5554...\r\nSuccessfully installed on device with identifier 'emulator-5554'.\r\nRefreshing application on device emulator-5554...\r\nSuccessfully synced application org.nativescript.testandroid on device emulator-5554.\r\nJS: NSUTR: fetching http://127.0.0.1:9876/context.json\r\nJS: NSUTR: fetching http://192.168.2.158:9876/context.json\r\n```\r\n\r\nI have also tried the `--justlaunch` flag but that doesn't have any impact. \r\n\r\n**To Reproduce**\r\n\r\n```\r\n$ tns create\r\n? First, what will be the name of your app? testandroid\r\n❯ Vue.js | Learn more at https://nativescript.org/vue\r\n\r\n$ cd testandroid\r\n$ npm i\r\n$ tns test init\r\n❯ mocha\r\n\r\n$ tns test android\r\n```\r\n\r\n**Expected behavior**\r\nThe test run completes with success and returns zero.\r\n\r\n**Sample project**\r\nhttps://github.com/groksrc/testandroid\r\n\r\n**Additional context**\r\nI have gone as far as recreating my android emulator just to make sure there wasn't something going on there. I am not behind a proxy and I do not have any network restrictions in place that may prevent communication between the processes. Running for iOS works as expected. I am on macOS High Sierra 10.13.6\r\n```\r\n$ tns test ios --justlaunch\r\nSearching for devices...\r\n28 11 2018 20:04:42.822:INFO [karma-server]: Karma v3.1.1 server started at http://0.0.0.0:9876/\r\n28 11 2018 20:04:42.824:INFO [launcher]: Launching browsers ios with concurrency unlimited\r\n28 11 2018 20:04:42.830:INFO [launcher]: Starting browser NativeScript Unit Test Runner\r\nExecuting before-shouldPrepare hook from /Users/drewcain/code/testandroid/hooks/before-shouldPrepare/nativescript-dev-webpack.js\r\nExecuting before-cleanApp hook from /Users/drewcain/code/testandroid/hooks/before-cleanApp/nativescript-dev-webpack.js\r\nPreparing project...\r\nExecuting before-prepareJSApp hook from /Users/drewcain/code/testandroid/hooks/before-prepareJSApp/nativescript-dev-webpack.js\r\nProject successfully prepared (ios)\r\nExecuting after-prepare hook from /Users/drewcain/code/testandroid/hooks/after-prepare/nativescript-dev-webpack.js\r\nExecuting after-prepare hook from /Users/drewcain/code/testandroid/hooks/after-prepare/nativescript-unit-test-runner.js\r\nExecuting before-shouldPrepare hook from /Users/drewcain/code/testandroid/hooks/before-shouldPrepare/nativescript-dev-webpack.js\r\nSkipping prepare.\r\nBuilding project...\r\nXcode build...\r\nProject successfully built.\r\nInstalling on device 960E5714-9A61-4FDB-958F-969910F95D87...\r\nSuccessfully installed on device with identifier '960E5714-9A61-4FDB-958F-969910F95D87'.\r\nSuccessfully transferred all files on device 960E5714-9A61-4FDB-958F-969910F95D87.\r\nRefreshing application on device 960E5714-9A61-4FDB-958F-969910F95D87...\r\nSuccessfully synced application org.nativescript.testandroid on device 960E5714-9A61-4FDB-958F-969910F95D87.\r\n28 11 2018 20:05:02.229:INFO [NativeScript / 12.1 (12.1; iPhone)]: Connected on socket Io9b362ScDWx7E7SAAAA with id NativeScriptUnit-4165\r\nNativeScript / 12.1 (12.1; iPhone): Executed 1 of 1 SUCCESS (0.008 secs / 0 secs)\r\nTOTAL: 1 SUCCESS\r\n```\r\n","author":{"url":"https://github.com/groksrc","@type":"Person","name":"groksrc"},"datePublished":"2018-11-29T02:07:50Z","url":"https://github.com/NativeScript/nativescript-cli/issues/4182"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2df7d7e2-5262-ea2e-6eb2-16c9f50bd45f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8542:1FAE:202B5D:2FEC62:6B01C050 |
| html-safe-nonce | 0dbd792f36a4eb81db146d731f31765ee12d8fc2bbf47bf3c028572e64060bb2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTQyOjFGQUU6MjAyQjVEOjJGRUM2Mjo2QjAxQzA1MCIsInZpc2l0b3JfaWQiOiIxNTQwNTUyMjA0NzY1NzQxMTM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 14e8d55c8ffedd1010f3fa955731ea759860d491e8ef3be133f8d34842fe8b28 |
| hovercard-subject-tag | issue:385536635 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/nativescript-cli/4182/issue_layout |
| twitter:image | https://opengraph.githubassets.com/86c10c9b78766670540330d085ab64b8e0303037541a72be61b027c0fdc93543/NativeScript/nativescript-cli/issues/4182 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/86c10c9b78766670540330d085ab64b8e0303037541a72be61b027c0fdc93543/NativeScript/nativescript-cli/issues/4182 |
| og:image:alt | Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): CLI: 5.0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | groksrc |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/nativescript-cli git https://github.com/NativeScript/nativescript-cli.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 21347346 |
| octolytics-dimension-repository_nwo | NativeScript/nativescript-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 21347346 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/nativescript-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width