Skip to content
This repository has been archived by the owner on Jul 13, 2022. It is now read-only.

Local changes not being picked up when running tests #21

Open
mansona opened this issue May 14, 2018 · 3 comments
Open

Local changes not being picked up when running tests #21

mansona opened this issue May 14, 2018 · 3 comments

Comments

@mansona
Copy link

mansona commented May 14, 2018

This is a bit of a strange issue that is hard to explain what is going on but I will try my best.

I was working on a reported issue in one of my addons, the issue was a strange behaviour in the FastBoot render hence the need for a FastBoot testing harness. I set up a test using ember-fastboot-addon-tests to attempt a "red/green" test, making sure that I could capture a failing test before getting it working again.

I managed to capture the failing scenario with a test but when I implemented the fix and tried to run ember fastboot:test it didn't actually pick up any of my changes. I then ran the dummy app with ember-cli-fastboot and it seemed to have fixed my issue when doing manual testing.

At this point I thought it was a cache issue so I cleared my dist and tmp folders and ran ember fastboot:test again and it still didn't work. Even a fresh build on Travis wasn't working correctly.

I then published the addon as a patch version because I was relatively sure the fix was valid because of my manual testing and then when running the local ember fastboot:test again it started working.

My best guess for a mental model of what is going on here is that the ember fastboot:test is somehow installing my addon from npm instead of using the local files, which would mean that it would need an npm publish before it would pick up changes that would fix any tests that are broken.

I could probably recreate this issue if you would like a demo, but I'm wondering if this is a known behaviour already before I spend the time on attempting a re-creation.

Let me know if you have any questions 👍

@simonihmig
Copy link
Member

@mansona thanks for reporting! This is strange, and certainly not an expected behavior! 🤔

Your addon should have been symlinked to the temporary app's folder, so it should pick up any changes without requiring you to publish it. This lib uses ember-cli-addon-tests under the hood, which symlinks the addon here: https://github.com/tomdale/ember-cli-addon-tests/blob/master/lib/utilities/pristine.js#L237-L267

Not sure what's happening in your case. Maybe you could run it with debugging output enabled:

DEBUG=ember-cli-addon-tests ember fastboot:test

This should output some symlink messages (see the source code).

Btw, you are using this under OSX/Linux or Win? I don't know for sure how the latter behaves, regarding symlinks...

@simonihmig
Copy link
Member

Oh wait a sec, just recalled this one: tomdale/ember-cli-addon-tests#176

Maybe this is what is happening to you?

@mansona
Copy link
Author

mansona commented May 14, 2018

@simonihmig as you can see by all the linked issues/PRs I have done a bit of investigation into this 😂 and yes I think that's the issue that I'm facing.

It's a long-standing issue with npm that they are in the process of fixing but we could potentially fix this if we could get the link part of the process to happen after all npm install commands are executed.

I had my best crack at it with the little amount of context I could follow in the time that I had, maybe you can see a way to navigate this? If you wanted to pair on this for a bit this week I'm free too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants