Skip to content

Astra parser unit test#166

Open
bvaic wants to merge 7 commits intodevelopfrom
astra-parser-unit-test
Open

Astra parser unit test#166
bvaic wants to merge 7 commits intodevelopfrom
astra-parser-unit-test

Conversation

@bvaic
Copy link
Copy Markdown
Contributor

@bvaic bvaic commented Apr 17, 2026

  • unit test currently only tests one day: 2027-03-31
  • sorted the buildings, rooms, and results in the parser to make the output deterministic which makes the unit test easier

Fixes: #150

bvaic added 6 commits April 14, 2026 23:28
* if no search index exists in mongo, one is created
* if the fields of the existing search index in mongo do not match the current model, the existing search index is updated
* the academic calendars are now uploaded with an additional url field containing the box url for the calendar
* bugfix: fixed past selector so that the links are extracted correctly and completely

Co-authored-by: SuchDominion shijiand2022@gmail.com
* test data for this unit test is held in `parser/testdata/astra/`
* currently only tests output of parsing one day: 2027-03-31
* made parser output deterministic by implementing sorting for buildings, rooms, and results
* the deterministic output makes the unit test much easier
@bvaic bvaic requested a review from mikehquan19 April 17, 2026 06:34
@bvaic
Copy link
Copy Markdown
Contributor Author

bvaic commented Apr 17, 2026

The failed checks are because it seems to be looking for a testdata/astra/input.html and I don't know why it's doing that. testdata/astra is a directory that I created to hold the test data for the astra parser unit test. Should I have done this differently?

@bvaic
Copy link
Copy Markdown
Contributor Author

bvaic commented Apr 17, 2026

I noticed that each test case directory like case_000 had an input.html file so I imagine that something thought that my astra directory was a test case directory. I just moved everything out of that directory and deleted the astra directory and now the checks pass. Maybe it would be better to have those files in a astra directory if there's a way to get around or fix that input.html check.

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.

Add unit-tests for the astra parser in parser/astraParser.go

1 participant