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

Tests Tests Tests -- Union is broken #42

Closed
ranchodeluxe opened this issue Apr 14, 2015 · 10 comments
Closed

Tests Tests Tests -- Union is broken #42

ranchodeluxe opened this issue Apr 14, 2015 · 10 comments

Comments

@ranchodeluxe
Copy link
Member

It's great that all this new development is happening, but why don't I see tests around the stuff we are merging into master?

Currenlty the union is broken

@mapsam
Copy link
Member

mapsam commented Apr 14, 2015

Because none of us know how to write them 😞 But I also think fixing union requires us to work on #5 before we can actually fix it.

@alukach
Copy link
Member

alukach commented Apr 14, 2015

Yup. it does seem broken. Weird because I tested it before pushing... Definitely highlights the need for more testing.

@thebigspoon Can you describe how it's broken? I get this error:

Uncaught TypeError: Cannot read property 'type' of undefined  turf.min.js:10 

@mapsam
Copy link
Member

mapsam commented Apr 14, 2015

That's breaking because turf is looking for a feature not a featureCollection. I think the big issue here is realizing that we need to actually write tests when we add new features. It's not going to happen automatically.

@alukach
Copy link
Member

alukach commented Apr 14, 2015

Yes, accompanying tests should be a requirement for all pull requests.

@alukach
Copy link
Member

alukach commented Apr 15, 2015

@thebigspoon Alright, trying again, I'm unable to reproduce the error. Can you post the files that you're trying? I think @svmatthews may be correct re: this being about feature vs featureCollection.

Here are two files that I was able to successfully union: https://gist.github.com/alukach/0bf4471e44a0243b66db

@mapsam
Copy link
Member

mapsam commented Apr 15, 2015

Sure thing. I'm trying to union two newly buffered geometries, which is where the problem exists. You can get the two original (eastbay & sf) files in this gist - below is a screencap of the process that results in the error:

dnc-union

@alukach
Copy link
Member

alukach commented Apr 15, 2015

So, were these always "broken"? No lost functionality, right?

I'm going to start taking a stab at #22 and #23 soon. I'll add those files in the "known failures" pile. I'm okay with there being failures at this current state, but we should make sure that we can pin down what fails (and hopefully why), and what doesn't, to make sure that there are at least no regressions.

@mapsam
Copy link
Member

mapsam commented Apr 15, 2015

Union used to work when before the new menu system was put in place ... but it was a super gross hack looking for the feature[0] if it was a featureCollection. Nothing that should have made its way into production. I'm also fine with this being broken now - we'll have to discuss how to properly deal with all of this especially since Turf.js doesn't take featureCollections with some of its modules.

@alukach
Copy link
Member

alukach commented Apr 15, 2015

Ah, okay, right, I do remember seeing these two lines and not knowing what they did. It's something that should have been brought up in the PR, my mistake. Well, we can add a kludge to make it work for now (driven by options), or move on to consider better solutions. I had another issue with buffer (Turfjs/turf-buffer#22) that is resolved when turf-buffer is upgraded (which has still yet to happen). Maybe this problem will just go away on upgrade as well? Worth testing before committing dev time on our end.

@mapsam
Copy link
Member

mapsam commented Apr 15, 2015

Heh, I submitted an issue to turf-union as well Turfjs/turf-union#8. It looks like some of the current turf modules are relying on jsts and don't account for all of the use cases. Hopefully it is upgraded soon ... or we could help out!

@mapsam mapsam added the turf label Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants