X Tutup
The Wayback Machine - https://web.archive.org/web/20200628004634/https://github.com/angular/angular/issues/33591
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

Provide better docs for contributors about running and debugging test projects #33591

Open
edusperoni opened this issue Nov 5, 2019 · 12 comments
Open

Comments

@edusperoni
Copy link

@edusperoni edusperoni commented Nov 5, 2019

📚 Docs or angular.io bug report

Description

The developer documentation should have a few examples and proper documentation on how to setup a contributing environment.

🔬 Minimal Reproduction

What's the affected URL?**

https://github.com/angular/angular/blob/master/docs/DEVELOPER.md

Anything else relevant?

I've been wrestling for a few hours with the repo and I'm still not able to properly setup a development environment for contributing. Ideally I'd like to test the changes I'm doing on a demo application before writing the tests, for example.

The documentation states how to run unit tests and build the npm packages, but that isn't very performant for running together with yarn link, even when using ibazel and linking dist/bin/packages/<package>/npm_package.

When working at the 8.2.13, I had to do some additional changes so the cli of my demo project would not complain about version 0.0.0 or that 8.2.13.with-local-changes was an invalid version.

I imagine I'm doing something very wrong, but unfortunately the documentation isn't helpful in this situation.

Asking around in gitter and other channels also yielded no result.

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Nov 5, 2019

@edusperoni this might not be exactly what you're looking for since my workflow is specifically for working on the docs, but does this help you? My workflow

@gkalpak
Copy link
Member

@gkalpak gkalpak commented Nov 5, 2019

This sounds like a duplicate of #31908.

@kapunahelewong kapunahelewong added this to Pending - Top of backlog in docs Nov 5, 2019
@edusperoni
Copy link
Author

@edusperoni edusperoni commented Nov 5, 2019

@kapunahelewong Unfortunately not exactly. Let me try to rephrase it:

Say I want to change code in @angular/core. Ideally I'd open a test application, change packages/core/src/refs.ts and it would automatically refresh this application with my changes.

Rebuilding all npm packages is an option, like what is suggested on #31908, but that seems way too heavy (multiple bundle generation every change and having to call the whole build again instead of running in watch mode), considering ibazel build //packages/core runs in a small fraction of that time.

I guess if I'd rephrase it into a question, it'd be: If I want to make a change to an angular package, how should I setup my dev environment so I could "test" (not unit/e2e testing) those changes?

@s-gbz
Copy link
Contributor

@s-gbz s-gbz commented Nov 7, 2019

Hey, that sounds a lot with what I've been up to recently. I'm happy to say that it finally works for me. If you can build packages localy on your machine "@angular/common": "file:../../angular/dist/packages-dist/common", might (/will?) be the quickest way since you can have bazel in watch mode.

Unfortunately though this only works on limited packages for me. E.g. including core & common is fine, but forms and module fail on unresolved dependencies.

In case you happen to struggle with peer dependencies (they're crucial!), just add them like so:

  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "https://123456-123456-gh.circle-artifacts.com/0/angular/router-pr12345-1a2b3c.tgz",
    "core-js": "^2.5.4",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "peerDependencies": {
    "@angular/core": "7.2.15",
    "@angular/common": "7.2.15",
    "@angular/platform-browser": "7.2.15",
    "@angular/compiler": "https://123456-123456-gh.circle-artifacts.com/0/angular/compiler-pr12345-1a2b3c.tgz",
    "zone.js": "0.10.2",
    "rxjs": "~6.3.3"
  },

An alternative is using artifacts from circleci - and yeah that is slower than building a single package localy, but hey gotta take what's given, right?


PS: Feel free to hit me up if you're stuck in the process (I've been there and it sucked). I'm also going to write a little blog post to adress this subject soon - please add further insights to #31908

@edusperoni
Copy link
Author

@edusperoni edusperoni commented Nov 8, 2019

@s-gbz Thanks! I'll try your solution today.

I'm trying to understand how the angular team actually develops the framework. Do they just write the tests before the feature and test once it all passes?

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented Nov 11, 2019

Oh, @edusperoni, thanks for clarifying. I wish I knew the answer - I'm still learning. :)

@SchnWalter
Copy link
Contributor

@SchnWalter SchnWalter commented May 2, 2020

I would also like to see some more information about how to debugg tests, but also an improved PR submission checklist, because on each push for #36897, I've discovered something new that I need to check: a new command or a new requirement.

@kapunahelewong
Copy link
Contributor

@kapunahelewong kapunahelewong commented May 7, 2020

cc @aikidave (docs team lead) fyi

@aikidave
Copy link
Contributor

@aikidave aikidave commented May 7, 2020

This is good information! I'll talk with folks and see how we can provide better information for you!

@aikidave aikidave self-assigned this May 7, 2020
@cerkiner
Copy link
Contributor

@cerkiner cerkiner commented Jun 1, 2020

What is the ETA on this? Is there any other online resource about running angular local fork? I am currently unable to test my changes, therefore unable to raise pull requests and contribute to angular.

@aikidave
Copy link
Contributor

@aikidave aikidave commented Jun 1, 2020

I'm afraid I don't have an ETA to share as yet. The documentation team is working through our backlog as best we can! Thanks for your patience.

@SchnWalter
Copy link
Contributor

@SchnWalter SchnWalter commented Jun 6, 2020

The "Running Tests Locally" section of docs/DEVELOPER.md doesn't seem to be enough to run all tests locally and the AIO pipelines fail if you make certain changes and you don't run those tests.

See #37389 (comment) and #37389 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
docs
Pending - Top of backlog
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.
X Tutup