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

Write tests and enable Parser service #2111

Closed
humphd opened this issue Apr 9, 2021 · 23 comments · Fixed by #2846, #3040 or #3302
Closed

Write tests and enable Parser service #2111

humphd opened this issue Apr 9, 2021 · 23 comments · Fixed by #2846, #3040 or #3302
Assignees
Labels
area: microservices type: enhancement New feature or request type: test Creation and development of test
Milestone

Comments

@humphd
Copy link
Contributor

humphd commented Apr 9, 2021

We landed the Parser service today, but we have it not starting the actual parser, nor do we have any tests. We need to fix both things. @c3ho added Jest configs for both unit and e2e tests, but there aren't any.

You can get some idea of how to work across services in tests by looking at my auth test here.

@humphd humphd added type: enhancement New feature or request type: test Creation and development of test area: microservices labels Apr 9, 2021
@c3ho c3ho self-assigned this Apr 9, 2021
@chrispinkney
Copy link
Contributor

chrispinkney commented Apr 20, 2021

@c3ho What's the status of this? Should someone else take this on?

@c3ho
Copy link
Contributor

c3ho commented Apr 21, 2021

@chrispinkney Hi Chris, sorry work has been killing me... as you can tell by the time of this message. Could someone else take it on?

@humphd humphd unassigned c3ho Apr 21, 2021
@humphd
Copy link
Contributor Author

humphd commented Apr 21, 2021

@c3ho no worries, thanks so much for getting the ball rolling on this. We'll take it from here.

@humphd humphd added this to the 2.1 Release milestone Apr 21, 2021
@manekenpix manekenpix modified the milestones: 2.1 Release, 2.2 Release, 2.1.5 Release Aug 13, 2021
@manekenpix manekenpix removed this from the 2.2.0 Release milestone Oct 8, 2021
humphd added a commit to humphd/telescope that referenced this issue Nov 3, 2021
@humphd
Copy link
Contributor Author

humphd commented Nov 3, 2021

When this gets fixed, make sure to undo what I did in #2441, where I disabled the parser service.

@chrispinkney
Copy link
Contributor

@manekenpix and I have been trying to work on this slowly and would like to keep going, nearing completion I think!

@humphd
Copy link
Contributor Author

humphd commented Jan 14, 2022

Cool. I know that @TueeNguyen is interested in working on this as well, maybe you can collaborate?

@aserputov aserputov added this to the 2.7 Release milestone Feb 2, 2022
@TueeNguyen
Copy link
Contributor

I did some comparison between backend and parser today, I see that parser doesn't have admin.js, user.js, stat.js, does parser need these files or these functionalities are handled somewhere else? (Later is probably correct) @manekenpix @chrispinkney @humphd

image

image

@manekenpix
Copy link
Member

manekenpix commented Feb 6, 2022

@TueeNguyen the parser service doesn't need those files. admin and user are now part of sso, and stat used to display info in the hero banner, but we don't use it anymore (the idea is to make status do that work).

@TueeNguyen
Copy link
Contributor

Thank you, I just want to confirm that those are not needed

@TueeNguyen
Copy link
Contributor

Reopened because I haven't got tests in

@humphd
Copy link
Contributor Author

humphd commented Feb 23, 2022

Or Docker bits to turn it on in docker-compose.yml

@TueeNguyen
Copy link
Contributor

@humphd, can you give me some idea how to write e2e test for this?

I plan on adding a few valid, invalid, youtube feeds to the queue, run it and after the queue is drained, I check data in redis, queue's stats

@humphd
Copy link
Contributor Author

humphd commented Feb 23, 2022

An e2e test would probably have you add some feeds to the queue (later we'd inject them into the database), have the feed queue start, wait on the queue to drain, then use the posts service to query the feeds and posts data.

@TueeNguyen
Copy link
Contributor

Great, my initial thought is almost correct. But, how do I use posts service in parser? Should I import it to parser?

@humphd
Copy link
Contributor Author

humphd commented Feb 23, 2022

You wouldn't use it in the parser, you'd fetch() it in your tests. The test is connecting the two, they know nothing about each other.

@TueeNguyen
Copy link
Contributor

Hi @humphd, How do I run e2e tests? I don't think I can run it locally.

@RC-Lee RC-Lee self-assigned this Feb 24, 2022
@humphd
Copy link
Contributor Author

humphd commented Feb 24, 2022

Identical way we do it in CI:

https://github.com/Seneca-CDOT/telescope/blob/master/.github/workflows/e2e-tests-ci.yml#L28-L30

@aserputov aserputov linked a pull request Feb 24, 2022 that will close this issue
8 tasks
@TueeNguyen
Copy link
Contributor

I did some research on testing bull queue using ioredis-mock, apparently, it only works with real redis connection. Refer to this issue OptimalBits/bull#962.

@humphd
Copy link
Contributor Author

humphd commented Feb 24, 2022

This is why we need to write e2e vs. mock unit tests (i.e., so we have a real redis).

@tpmai22 tpmai22 modified the milestones: 2.8 Release, 2.9 Release Mar 11, 2022
@aserputov aserputov removed their assignment Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment