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, Refactoring, and More #38

Merged
merged 48 commits into from
Aug 22, 2017
Merged

Tests, Refactoring, and More #38

merged 48 commits into from
Aug 22, 2017

Conversation

jpitlor
Copy link
Collaborator

@jpitlor jpitlor commented Jun 14, 2017

Hello, everyone!

This is a pretty huge PR. There are tons of changes. I'm opening it now so people can have a chance to look at the code. A lot of it I don't plan on changing before a formal review, so if you want to make comments, please do. The earlier we catch bugs, the better!

Be warned, I have not actually ran the tests to make sure they work. I'm still finishing writing up the mock data, so that part will be changing, but everything else shouldn't.

Later in this PR, I will make sure to write:

  • A changelog
  • A migration guide

Hopefully, after we merge this, maintaining the server and adding features will be easier, and hopefully it's easier to read so newcomers aren't quite as daunted

Side note: I'm definitely going against the typical goal of branches in that this is a "super branch" doing a lot of things at once. It's impossible to get fixed now, but I suggest not doing this moving forward

Copy link
Contributor

@hughesjeff hughesjeff left a comment

Choose a reason for hiding this comment

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

Please update the route to be /v2/ since this is a breaking change.

Copy link
Contributor

@hughesjeff hughesjeff left a comment

Choose a reason for hiding this comment

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

Can we also get a route to get all room names?

Dockerfile Outdated
@@ -27,7 +27,7 @@ RUN apt-get install -y -q --no-install-recommends \
&& apt-get -y autoclean

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION 6.9.4
ENV NODE_VERSION 7.9.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we either update this to 8.x latest, or downgrade to the latest LTS?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I bumped to 8.4, but I would not feel comfortable always pulling the latest. We should stay at one version and bump as needed so nothing breaks out of the blue. We also cannot go below 7.9 because we'd lose async/await support

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 8, 2017

RE node version: yes, i can bump it up
RE rooms route: yes, that's trivial
RE v2 - which routes? i don't think i changed any output or input of any routes unless i'm forgetting something. i tried to keep the interface identical

@hughesjeff
Copy link
Contributor

The room names have changed versus the old version since we're getting them dynamically now. We used to have them hard-coded, and since they have changed names, the app will crash if you try to use it on the new server. I updated the app to work against this and Android O on https://github.com/Purdue-ACM-SIGAPP/PurdueLaundry-android/tree/server-update-v2 branch.

@hughesjeff
Copy link
Contributor

I'd like to update the app to pull the rooms from the server, so once we get the routes done, I can work on implementing that.

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

At this point we have a green build. I have ignored 8 tests which test getAllMachines and getMachinesAt. These are a little bit more difficult to test since there are more things to mock. The latter I will be able to unignore with minimal effort soon, but the former we should refactor first. I created #43 for it

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

@hughesjeff I'm revisiting code changes now that the build is green. why would the names of rooms have changed? the old information never changed, just new rooms added

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

Also @hughesjeff can you redo your code review? github is getting mad that the commit hashes are missing since i rebased from your codeowners commit

@hughesjeff
Copy link
Contributor

The room names used to be hard coded with their URLs. Now that we're getting them dynamically, they've changed. So it went from cary to Cary Quad West Laundry in the JSON response.

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

D'oh! I completely forgot about those keys. Oops! Ill get the old route back for the v1 and change that to v2

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

@hughesjeff I added that route in, so if there's nothing else you wanted me to add, i'll mark the requested changes as made

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 19, 2017

Alo @vidia @vieck we're probably merging this relatively soonish, so review the code if you want

@hughesjeff
Copy link
Contributor

So I wasn't certain how we wanted to handle this. We can discuss during the meeting tomorrow, but I'm uncertain if we want to keep the v1 and v2 instances separate and tie them together with nginx, or put them together like this.

@jpitlor
Copy link
Collaborator Author

jpitlor commented Aug 21, 2017 via email

@jpitlor jpitlor merged commit aa6a3e6 into dev Aug 22, 2017
@jpitlor jpitlor deleted the tests branch August 22, 2017 23:15
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.

2 participants