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

Jasmine refactor/backfill command/creating collections service2 #974

Conversation

haxwell
Copy link
Contributor

@haxwell haxwell commented Dec 22, 2017

So, this commit shows where I'm going with unit tests. There is a lot of duplicate functionality across the commands, strategies, and exchanges. I want to DRY that up, using one service function for each place we currently call that duplicate functionality.

To that end, I've created collection-service.js, and called it from the command backfill.js. Also, to the point of this whole effort, I created a unit test for the collection service.

@JensvdHeydt
Copy link
Contributor

You're completely right. There is duplicate code all over the place and it's very hard to refactor to achieve testability. Also having functions declared inside of functions is bad. It's very hard to understand the code flow in the project's current state.

lib/_codemap.js Outdated
'slow_stochastic': require('./slow_stochastic')
'slow_stochastic': require('./slow_stochastic'),

'collection-service': require('./services/collection-service')
Copy link
Contributor

@JensvdHeydt JensvdHeydt Dec 24, 2017

Choose a reason for hiding this comment

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

I think, "/services/collection-service'" should be named "/services/collection". No need to duplicate the "service". What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, there's no need, still I think it adds more than it hurts.

@JensvdHeydt
Copy link
Contributor

@haxwell @DeviaVir I'd like to have automatic unit testing and codestyle checks using Travis CI. Do we have enough access rights to change the project settings?

@DeviaVir
Copy link
Owner

DeviaVir commented Dec 27, 2017

@JensvdHeydt no, I do not. I've been thinking about moving it to a fork I control, but that's the "nuclear" option

@tiagosiebler
Copy link
Contributor

@DeviaVir if we can't get hold of @carlos8f and he's the only one able to give these privileges, I think it's an option worth considering. Hard fork with credit to original author.

@DeviaVir
Copy link
Owner

@tiagosiebler reached out to github support, they've been helpful in the past, maybe they have a solution for this too.

@DeviaVir
Copy link
Owner

They've given me a new API endpoint that will allow me to migrate all issues. I've created #1010 to track and get more opinions.

@DeviaVir DeviaVir merged commit aa39df6 into DeviaVir:master Dec 28, 2017
kernelsndrs pushed a commit to kernelsndrs/zenbot that referenced this pull request Dec 28, 2017
…aVir#974)

* Created collection-service.js, and a unit test. Refactored backfill command to use the service.

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

Successfully merging this pull request may close these issues.

4 participants