Skip to content

Coverage in Engines  #180

Closed
Closed

Description

@wojm

I'm having trouble getting coverage in engines to work. This is specific to a private repo, but I've tried running coverage in this repo without success.

Steps to reproduce:

cd test/fixtures/my-app-with-in-repo-engine/
COVERAGE=true ember test
cd ../../..
vim coverage/coverage-summary.json 

This will show that there are a total of 0 lines in the report although all of the tests have been run.

There is an active PR that seems related to this:

Some past issues that seem related:

As a followup for my specific scenario: my app/ folder and /lib folder (lib contains all my engines) are on the same level. When I move the lib folder into the app folder, coverage works fine

Activity

  1. RobbieTheWagner commented on May 9, 2018

    @RobbieTheWagner
    Collaborator

    @wojm this seems odd. We have test cases that check that in-repo engines work. Can you share your versions of ember-cli-code-coverage, ember-cli, engines, etc?

  2. wojm commented on May 9, 2018

    @wojm
    Author

    For my specific application these are the relevant dependencies in package.json (I've removed the ones I'm certain don't affect the issue):

        "broccoli-asset-rev": "^2.4.5",
        "ember-cli": "~3.0.0",
        "ember-cli-app-version": "^3.0.0",
        "ember-cli-babel": "^6.8.2",
        "ember-cli-code-coverage": "^0.4.2",
        "ember-cli-dependency-checker": "^1.3.0",
        "ember-cli-deploy": "1.0.0",
        "ember-cli-deploy-build": "1.0.0",
        "ember-cli-deploy-display-revisions": "^1.0.0",
        "ember-cli-htmlbars": "^1.1.1",
        "ember-cli-htmlbars-inline-precompile": "^0.4.0",
        "ember-cli-inject-live-reload": "^1.4.1",
        "ember-cli-mirage": "0.4.6",
        "ember-cli-qunit": "^4.3.1",
        "ember-cli-release": "^0.2.9",
        "ember-cli-sass": "^7.0.0",
        "ember-cli-segment": "2.1.0",
        "ember-cli-shims": "^1.2.0",
        "ember-cli-sri": "^2.1.0",
        "ember-cli-test-loader": "^2.1.0",
        "ember-cli-typescript": "^1.2.1",
        "ember-cli-yuidoc": "0.8.8",
        "ember-data": "~3.0.0",
        "ember-engines": "0.5.14",
        "ember-qunit-nested-module-blueprints-polyfill": "^1.1.1",
        "ember-resolver": "^4.1.0",
        "ember-responsive": "2.0.2",
        "ember-router-service-polyfill": "^1.0.1",
        "ember-source": "~3.0.0",
        "gradstop": "Siddharth11/gradStop.js#b3b65d09ef892277b30d249510d51a0cb0f65401",
        "loader.js": "^4.2.3",
        "lodash": "3.10.1",
    

    In the above reproduction details, I am working in ember-cli=code-coverage with version 1.0.0-beta.4 and the package.json is as follows:

    {
      "name": "ember-cli-code-coverage",
      "version": "1.0.0-beta.4",
      "description": "Code coverage for ember projects using Istanbul",
      "keywords": [
        "ember-addon"
      ],
      "license": "MIT",
      "author": "Katie Gengler",
      "contributors": [
        "Matthew Dahl (https://github.com/sandersky)",
        "Robert Jackson (https://github.com/rwjblue)",
        "Robert Wagner (https://github.com/rwwagner90)"
      ],
      "directories": {
        "doc": "doc",
        "test": "tests"
      },
      "repository": "https://github.com/kategengler/ember-cli-code-coverage",
      "scripts": {
        "node-test": "mocha test/**/*-test.js",
        "browser-test": "COVERAGE=true ember test",
        "lint:js": "eslint ./*.js addon addon-test-support app config lib server test-support test tests",
        "test": "npm run-script lint:js && npm run-script node-test",
        "changelog": "lerna-changelog"
      },
      "dependencies": {
        "babel-core": "^6.24.1",
        "babel-plugin-istanbul": "^4.1.6",
        "babel-plugin-transform-async-to-generator": "^6.24.1",
        "body-parser": "^1.15.0",
        "co": "^4.6.0",
        "ember-cli-babel": "^6.6.0",
        "ember-cli-htmlbars": "^2.0.1",
        "ember-cli-version-checker": "^2.0.0",
        "extend": "^3.0.0",
        "fs-extra": "^5.0.0",
        "istanbul-api": "^1.1.14",
        "lodash.concat": "^4.5.0",
        "node-dir": "^0.1.16",
        "rsvp": "^4.8.1",
        "walk-sync": "^0.3.2"
      },
      "devDependencies": {
        "broccoli-asset-rev": "^2.4.5",
        "chai": "^4.1.2",
        "chai-files": "^1.2.0",
        "ember-cli": "~3.0.0-beta.2",
        "ember-cli-addon-tests": "^0.11.0",
        "ember-cli-dependency-checker": "^2.0.0",
        "ember-cli-eslint": "^4.2.1",
        "ember-cli-htmlbars": "^2.0.1",
        "ember-cli-htmlbars-inline-precompile": "^1.0.0",
        "ember-cli-inject-live-reload": "^1.4.1",
        "ember-cli-qunit": "^4.1.1",
        "ember-cli-shims": "^1.2.0",
        "ember-cli-sri": "^2.1.0",
        "ember-cli-uglify": "^2.0.0",
        "ember-disable-prototype-extensions": "^1.1.2",
        "ember-exam": "1.0.0",
        "ember-export-application-global": "^2.0.0",
        "ember-load-initializers": "^1.0.0",
        "ember-maybe-import-regenerator": "^0.1.6",
        "ember-resolver": "^4.0.0",
        "ember-source": "~3.0.0-beta.1",
        "ember-source-channel-url": "^1.0.1",
        "ember-try": "^0.2.23",
        "eslint-plugin-ember": "^5.0.0",
        "eslint-plugin-node": "^5.2.1",
        "fixturify": "^0.3.4",
        "glob": "^7.1.2",
        "lerna-changelog": "^0.7.0",
        "loader.js": "^4.2.3",
        "mocha": "^5.0.0",
        "rimraf": "^2.6.2",
        "sinon": "^4.2.2"
      },
      "engines": {
        "node": "^4.5 || 6.* || >= 7.*"
      },
      "ember-addon": {
        "configPath": "tests/dummy/config"
      },
      "changelog": {
        "repo": "kategengler/ember-cli-code-coverage",
        "labels": {
          "breaking": ":boom: Breaking Change",
          "enhancement": ":rocket: Enhancement",
          "bug": ":bug: Bug Fix",
          "documentation": ":memo: Documentation",
          "internal": ":house: Internal"
        }
      }
    }
    
  3. gar commented on Sep 4, 2018

    @gar

    fwiw, we were experiencing the same problem - our code coverage did not include anything in the lib directory which was at the same level as the app directory.

    For us, simply upgrading from 0.4.2 to v1.0.0-beta.4 fixed the issue without any further configuration needed - we now see files from the lib folder in coverage/index.html.

  4. RobbieTheWagner commented on Sep 4, 2018

    @RobbieTheWagner
    Collaborator

    Yes, updating should fix the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions