Skip to content

Module unification support#198

Closed
abhilashlr wants to merge 6 commits intoember-cli-code-coverage:masterfrom
abhilashlr:Module_Unification
Closed

Module unification support#198
abhilashlr wants to merge 6 commits intoember-cli-code-coverage:masterfrom
abhilashlr:Module_Unification

Conversation

@abhilashlr
Copy link

@abhilashlr abhilashlr commented Sep 22, 2018

What this PR does?
Fix for #197

  • Partial support for module unification based folder structure.
  • Coverage takes -test.js files that are part of the individual folders. (Needs help)
  • Add readme

@RobbieTheWagner
Copy link
Collaborator

@kategengler do you have any insights on the items marked as needs help for this PR? I haven't tried using MU myself, and wanted to get your input, since you are likely more familiar with all the changes that would be necessary here and the inner workings on MU apps.

@kategengler
Copy link
Collaborator

I'm not sure. I'll investigate.

@NullVoxPopuli
Copy link

I'm not sure if I've configured something wrong with sourcemaps, but my line annotations are way off
image

@abhilashlr
Copy link
Author

@NullVoxPopuli are tests running twice for you as well?

@NullVoxPopuli
Copy link

I think things are only running once for me

@NullVoxPopuli
Copy link

proof: https://gitlab.com/NullVoxPopuli/emberclear/-/jobs/105285122

@abhilashlr
Copy link
Author

@rwwagner90 @kategengler Looks like all the points are addressed now. Travis seems to fail and should be fixed by #202

@RobbieTheWagner
Copy link
Collaborator

@abhilashlr the master branch is passing with babel 7, we would need the same to be true here.

@abhilashlr abhilashlr closed this Oct 18, 2018
@abhilashlr abhilashlr reopened this Oct 18, 2018
@abhilashlr
Copy link
Author

@rwwagner90 there is no change in this PR with respect to ember-cli-babel. Can you please help me in resolving that issue if so?

@RobbieTheWagner
Copy link
Collaborator

RobbieTheWagner commented Oct 19, 2018

@abhilashlr yes, I can help debug. Aside from the test issues right now, does this correctly report coverage for your MU project?

@abhilashlr
Copy link
Author

@rwwagner90 yes it does report them correctly.

@NullVoxPopuli
Copy link

@abhilashlr, you don't have issues with highlighting accuracy? Maybe I configured typescript wrong. Hmm

@abhilashlr
Copy link
Author

Nope @NullVoxPopuli, In my sample app that has MU without typescript, highlight seems fine.

@NullVoxPopuli
Copy link

NullVoxPopuli commented Nov 13, 2018

if someone could review the configuration of my typescript setup, that'd be great... cause something is off.

tsconfig:

{
  "compilerOptions": {
    "target": "ES2017",
    "allowJs": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "noEmitOnError": false,
    "noEmit": true,
    "inlineSourceMap": true,
    "inlineSources": true,
    "noImplicitAny": true,
    "noImplicitThis": true,
    "noImplicitReturns": false,
    "alwaysStrict": true,
    "strictNullChecks": true,
    "strictPropertyInitialization": true,
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "baseUrl": ".",
    "module": "es6",
    "paths": {
      "emberclear/config/*": [
        "config/*"
      ],
      "emberclear/tests/*": [
        "tests/*"
      ],
      "emberclear/*": [
        "src/*"
      ],
      "emberclear/src/*": [
        "src/*"
      ],
      "*": [
        "types/*"
      ],
      "@ember": [
        "node_modules/@types/ember/index.d.ts"
      ],
      "fetch": [
        "node_modules/ember-fetch/index.d.ts"
      ],
      "tweetnacl": [
        "node_modules/tweetnacl/nacl.d.ts"
      ]
    }
  },
  "include": [
    "src",
    "tests",
    "types"
  ]
}

ember-cli-babel.js

  let app = new EmberApp(defaults, {
    hinting: false,
    minifyJS: { enabled: false },
    minifyCSS: { enabled: isProduction },


    babel: {
      sourceMaps: 'inline'
    //   plugins: [
    //     ['@babel/plugin-syntax-decorators', { legacy: true }]
    //   ]
    },

    sourcemaps: {
      enabled: !isProduction,
      extensions: 'js'
    },

    'ember-cli-babel': {
      includePolyfill: false,
      disablePresetEnv: true,
      disableDebugTooling: isProduction,
      // Will not build if uncommented:
      // disableEmberModulesAPIPolyfill: true
      // compileModules: false,
    },
// ...

and I'm running coverage with:

COVERAGE=true yarn test

where test is defined as:

    "test": "yarn ember exam --random",

and my coverage report looks like this:
image

the highlighting is super weird -- partial word highlighting and such..
it looks like the line-hit counts are correct, or at least align with things that make sense.

So, what have I missed it configuration? or is something wrong?

I'm using these versions of things:

$ yarn outdated
yarn outdated v1.12.3
info Color legend : 
 "<red>"    : Major Update backward-incompatible updates 
 "<yellow>" : Minor Update backward-compatible features 
 "<green>"  : Patch Update backward-compatible bug fixes
Package                 Current      Wanted Latest Package Type    URL                                                                                                 
ember-cli               3.5.0        exotic exotic devDependencies github:ember-cli/ember-cli#6e84ea4da023960f89404a781375223e6c833609                                 
ember-cli-babel         6.17.2       6.17.2 7.1.3  devDependencies git://github.com/babel/ember-cli-babel.git                                                          
ember-cli-code-coverage 1.0.0-beta.6 exotic exotic devDependencies abhilashlr/ember-cli-code-coverage#Module_Unification                                               
ember-data              3.5.0        exotic exotic devDependencies github:emberjs/data#8b7de9e69f2418ef9747aa4ca51f59efff9d669c                                        
ember-router-helpers    0.2.0        exotic exotic devDependencies github:rwjblue/ember-router-helpers                                                                 
ember-service-worker    0.7.0        exotic exotic devDependencies github:DockYard/ember-service-worker#c78cb28432af5eeb6e4adc0961fb7f8da025cd14                       
ember-source            3.6.0-canary exotic exotic devDependencies https://s3.amazonaws.com/builds.emberjs.com/canary/shas/a662910a5ce72ce84ba8867a5abfcf1b30158dcf.tgz
libsodium               0.7.3        exotic exotic dependencies    github:jedisct1/libsodium.js#8fa117918df38f52668feaf9cbc498c633671855                               
libsodium               0.7.3        exotic exotic dependencies    github:jedisct1/libsodium.js#8fa117918df38f52668feaf9cbc498c633671855                               
qr-scanner              0.4.0        exotic exotic dependencies    github:nimiq/qr-scanner                                                                             
Done in 2.01s.

@NullVoxPopuli
Copy link

@abhilashlr looks like my tests are running twice:
#204 (comment)

I ran them with

$ COVERAGE=true yarn start:dev
yarn run v1.12.3
$ SW_DISABLED=true FASTBOOT_DISABLED=true yarn start -p 4201
$ yarn ember serve -p 4201 -p 4201
$ EMBER_CLI_MODULE_UNIFICATION=true node_modules/.bin/ember serve -p 4201 -p 4201

(looks like I have a duplicate port specification, oops)

@NullVoxPopuli
Copy link

can this be rebased? I'm using babel7 now, and this branch no longer works

@RobbieTheWagner
Copy link
Collaborator

@NullVoxPopuli I resolved the conflict, but not sure if that also will update the other things.

@NullVoxPopuli
Copy link

hmm, something is still wrong. I'm still getting failures with coverage enabled. :-\

@RobbieTheWagner
Copy link
Collaborator

@NullVoxPopuli I am not sure how to rebase this, since it is from @abhilashlr's fork.

@AvremelM
Copy link

AvremelM commented Jan 7, 2019

@NullVoxPopuli Perhaps try my fork? It won't rebase this PR, but it'll tell you if rebasing makes it work for you.

@NullVoxPopuli
Copy link

NullVoxPopuli commented Jan 8, 2019

@HodofHod almost: https://gitlab.com/NullVoxPopuli/emberclear/-/jobs/142813613

now it looks like coverage-merge doesn't seem to work :(

I guess because coverage just isn't tracked now?
I checked one of the individual coverage reports

@abhilashlr
Copy link
Author

Is there something that needs to be worked on this further? Please let me know

@NullVoxPopuli
Copy link

I guess, it just needs to work against this: https://github.com/ember-cli/ember-octane-blueprint/

my emberclear code may have something else going on, with typescript being involved and everything.

Just need two smoke tests, I guess: Octane: js + ts (e-c-ts@2)

@NullVoxPopuli
Copy link

MU, as we know it, has been descoped. This should probs be closed

@RobbieTheWagner
Copy link
Collaborator

@NullVoxPopuli it will still eventually happen, supposedly, so couldn't hurt to keep this around for a bit.

@lstrzebinczyk
Copy link

Module unification is now dead, isn't it?

@NullVoxPopuli
Copy link

yup.

@RobbieTheWagner
Copy link
Collaborator

Closing since MU is dead

@abhilashlr abhilashlr deleted the Module_Unification branch January 19, 2020 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Comments