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/3.0 #95

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open

Migration/3.0 #95

wants to merge 54 commits into from

Conversation

jankapunkt
Copy link
Collaborator

@jankapunkt jankapunkt commented Aug 1, 2024

This will make the package fully 3.0 aware

TODOS

  • npm deps updated
  • test app 3.0 updated
  • local lint passing
  • local tests (someapp) passing
  • fix html reporter No coverage information has been collected #85
  • ci (github actions lint and test) running
  • coverage runs on multiple apps (needs users to test)
  • legacy coverage runs on multiple apps (needs users to test)
  • no package conflicts
  • documentation and README updated
  • fix broken sourcemap paths

StorytellerCZ and others added 4 commits July 16, 2024 09:11
A quick attempt to upgrade legacy-coverage for Meteor 3,
Following #91, this is an attempt to quickly update the main package for Meteor 3.
Update legacy-coverage for Meteor 3
@jankapunkt jankapunkt self-assigned this Aug 1, 2024
@jankapunkt
Copy link
Collaborator Author

@serut circleci fials due to permission issues, which only you can fix. Do you want to fix it or do you want circleci being removed from checks?

@jankapunkt jankapunkt linked an issue Aug 1, 2024 that may be closed by this pull request
@jankapunkt
Copy link
Collaborator Author

jankapunkt commented Aug 1, 2024

@serut is there a reason why coverage and legacy coverage are split into two? Does it make sense to merge them, since Meteor 3.0 is breaking anyway? Nevermind

@jankapunkt
Copy link
Collaborator Author

@serut I finally got it running and it also works in my apps and packages. However circleci is still not working but this is nothing I can fix. If we want people to test the new version it might make sense to publish a relase candidate for both of the packages.

@serut
Copy link
Owner

serut commented Aug 1, 2024

@serut I finally got it running and it also works in my apps and packages. However circleci is still not working but this is nothing I can fix. If we want people to test the new version it might make sense to publish a relase candidate for both of the packages.

I've fixed the SSH key to allow checkout. Do you know how to fix the build with Circle CI ?

Otherwise yes we can remove CircleCI build.

@jankapunkt
Copy link
Collaborator Author

@serut I never used it so I don't know a thing how it works internally, sorry. Would you mind publishing a 4.3.0-rc.0 for coverage and 0.4.0-rc.0 for legacy coverage? With these I could gather a few people from the community like @StorytellerCZ to test the RCs with real apps beyond my own.

@serut
Copy link
Owner

serut commented Aug 1, 2024

I do not have a setup to build the package and publish a release candidate. I've added you on Atmosphere package to let you publish the release candidate version of the package.

legacy coverage is for package and coverage package is for Meteor app as far I remember

@jankapunkt
Copy link
Collaborator Author

Well I finally got it covered. The crucial parts are to add a .babelrc file with plugin config to the package-level root (tested with some other package). Then there is another fix (that seems to apply only to this package) and this is to add **/lmieulet:meteor-coverage/** to include in coverage.json in order to include this package.

@jankapunkt
Copy link
Collaborator Author

jankapunkt commented Aug 6, 2024

@serut @StorytellerCZ please note that this package is not backwards compatible to Meteor 2 so I prepared the versions in the documentation etc. for a major bump to

these versions will be updated, once I have meteortesting:[email protected] released, which will add 5.0.0 to the weak dependency. Otherwise the dependencies would not resolve.

See: Meteor-Community-Packages/meteor-mocha#157

@jankapunkt
Copy link
Collaborator Author

Instrumentation works fine but sourceMap paths seem to be different in Meteor 3. Basically package paths not contains author:pacakgename when instrumented by babel+istanbul which leads to missing source files when opening the specific files in the coverage reports.

Problem is, that filePath can't be modified, because it's a read only so i will try to copy them as a while into a new Object and then alter the paths.

@jankapunkt
Copy link
Collaborator Author

I opened an issue as it seems this is a problem with Meteor itself, since the babel-plugin-istanbul gets already a wrong path at compile-time: meteor/meteor#13287

@serut
Copy link
Owner

serut commented Aug 10, 2024

Nice work @jankapunkt !

If the source map file path cannot be fixed on the Meteor side, maybe we can try to fix it on the package side as the file must be generated and located somewhere?

While we wait for the fix on the Meteor side, we can publish a version on atmosphere to let people test the release ?

@jankapunkt
Copy link
Collaborator Author

@serut yes please publish an RC or Beta of them both packages so people can at least test if things work on the application-level tests.

@jankapunkt
Copy link
Collaborator Author

jankapunkt commented Aug 20, 2024

@serut when attempting to alter the paths afterwards, I get

W20240820-14:19:47.948(2)? (STDERR) [coverage] TypeError: Cannot set property path of #<FileCoverage> which has only a getter
W20240820-14:19:47.948(2)? (STDERR)     at Object.writeFile (packages/lmieulet:meteor-coverage/server/report/report-generic.js:50:43)
W20240820-14:19:47.948(2)? (STDERR)     at Object.generate (packages/lmieulet:meteor-coverage/server/report/report-generic.js:38:10)
W20240820-14:19:47.948(2)? (STDERR)     at Object.generateJSONReport (packages/lmieulet:meteor-coverage/server/report/report-remap.js:29:16)
W20240820-14:19:47.949(2)? (STDERR)     at Object.generate (packages/lmieulet:meteor-coverage/server/report/report-remap.js:39:10)
W20240820-14:19:47.949(2)? (STDERR)     at Object.generateReport (packages/lmieulet:meteor-coverage/server/report/report-service.js:29:21)
W20240820-14:19:47.949(2)? (STDERR)     at Object.exportFile (packages/lmieulet:meteor-coverage/server/handlers.js:86:19)
W20240820-14:19:47.949(2)? (STDERR)     at packages/lmieulet:meteor-coverage/server/router.js:53:16
W20240820-14:19:47.949(2)? (STDERR)     at packages/lmieulet:meteor-coverage/server/router.js:26:19
W20240820-14:19:47.949(2)? (STDERR)     at processTicksAndRejections (node:internal/process/task_queues:95:5)

where FileCoverage is created by the istanbul instrumenter and actually has literally only getters :-D

@serut
Copy link
Owner

serut commented Aug 28, 2024

Strangely, I cannot publish a rc version :

=> Build failed:                              
   
   While selecting package versions:
   error: Conflict: Constraint lmieulet:[email protected] || 2.0.1 || 3.0.0 || 4.0.0 || 5.0.0 is not satisfied by lmieulet:meteor-coverage 5.0.0-rc.0.
   Constraints on package "lmieulet:meteor-coverage":
   * lmieulet:meteor-coverage@=5.0.0-rc.0 <- top level
   * lmieulet:[email protected] <- local-test:lmieulet:meteor-coverage 5.0.0-rc.0
   * lmieulet:[email protected] || 2.0.1 || 3.0.0 || 4.0.0 || 5.0.0 <- meteortesting:mocha 3.2.0

So I'll publish directly the version 5.0.0

*/
Response.send = ({ res, type, status, message, json }) => {
if (res.headersSent) {
return;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return;
return res.end();

Do you agree @jankapunkt ? It will fix the last lint issue

@jankapunkt
Copy link
Collaborator Author

@serut I can add the RC to meteortesting:mocha so you don't need to publish a new major immediately

@serut
Copy link
Owner

serut commented Aug 28, 2024

@serut I can add the RC to meteortesting:mocha so you don't need to publish a new major immediately

It's too late !! 5.0.0 is available with current branch content

@jankapunkt
Copy link
Collaborator Author

No problem, will keep working on this until we get it running for apps and packages

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.

Meteor 3.0 compatibility
4 participants