publiclab / simple-data-grapher

Turns CSVs into graphs in a few simple steps; embeds onto other websites!
https://publiclab.github.io/simple-data-grapher/
GNU General Public License v3.0
39 stars 52 forks source link

Travis CI setup for repo #117

Closed Uzay-G closed 4 years ago

Uzay-G commented 4 years ago

Fixes #98

Hey, I managed to configure a working travis-ci build for the repository. It launches a server whenever someone pushes and then tests the changes on the server. You can see an example build here. For some reason though I am getting an error on the tests:

 1 failing
  1) csv string file upload test
       should select graph type:
     TypeError: Cannot read property 'click' of null

I don't think it's because of the Travis environment though so I believe the build works. What do you think @debck @starkblaze01? Thanks :smile:

welcome[bot] commented 4 years ago

Thanks for opening this pull request! This space is protected by our Code of Conduct - and we're here to help. Dangerbot will test out your code and reply in a bit with some pointers and requests. You can create issues here for any installation help There may be some errors, but don't worry! We'll work through them with you! 👍🎉😄 It would be great if you can tell us your Twitter handle so we can thank you properly?

Uzay-G commented 4 years ago

I don't understand the error. Did this issue already exist with testing?

Uzay-G commented 4 years ago

@debck @starkblaze01 I found the error for the travis build. This test looks for an element with id 'graph_type2' that doesn't exist on any of the pages. I think something might have changed in the codebase and the test did not get updated.

Uzay-G commented 4 years ago

I need to update the test somehow.

chen-robert commented 4 years ago

Oh I see what you mean now @Uzay-G, could you try adding

console.log(graph_type)

to see if the element $("#graph_type2") exists anywhere? I think it might be dynamically generated

Uzay-G commented 4 years ago

Yeah good idea. I just tried and it returned undefined so yeah I think I need to update the test.

chen-robert commented 4 years ago

The commit which made this test was 90ad4109769f14778dea0f56594802367c370189. If you do git checkout 90ad4109769f14778dea0f56594802367c370189, you can see what the repository was like when the test was first made, which might help?

After running

grep -rnw graph_type .

I found the following line of code.

./src/View.js:307:                radio.id="graph_type"+count;

It seems the graph_type2 id was constructed dynamically here!

chen-robert commented 4 years ago

This line of code has been refactored, but seems to correspond to https://github.com/publiclab/simple-data-grapher/blob/main/src/View.js#L371

Uzay-G commented 4 years ago

Wait so you think there is an element with id graph_type2?

chen-robert commented 4 years ago

I think there used to be one, when the test was first made. But then the code got changed which changed the id as well. I provided a link to where the new id might be set, if you want to dig a bit deeper

Uzay-G commented 4 years ago

It's quite late where I am so I will remove the deprecated test for now

Uzay-G commented 4 years ago

Hey @debck and @IshaGupta18, is this good to merge? Thanks

welcome[bot] commented 4 years ago

Congrats on merging your first pull request! 🙌🎉⚡️ Your code will likely be published to PublicLab.org in the next few days, but first it will be published to https://stable.publiclab.org/ (it will take some minutes for this to load, and until then you may see logs from the build process). Please test out your work on this testing server and report back with a comment that all has gone well! Do join our weekly check-in to share your this week goal and the awesome work you did 😃. Please find the link pinned in the issue section 📝 Now that you've completed this, you can help someone else take their first step! Reach out to someone else working on theirs on Public Lab's code welcome page. Thanks!

Help others take their first step

Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌

https://code.publiclab.org

Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕

People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉

Read about how to help support another newcomer here, or find other ways to offer mutual support here.