Skip to content

Comments

Add test case for metadata query and github actions to run tests#5

Open
anisjonischkeit wants to merge 6 commits intok-lar:mainfrom
anisjonischkeit:add-test-for-metadata-query
Open

Add test case for metadata query and github actions to run tests#5
anisjonischkeit wants to merge 6 commits intok-lar:mainfrom
anisjonischkeit:add-test-for-metadata-query

Conversation

@anisjonischkeit
Copy link

@anisjonischkeit anisjonischkeit commented Apr 19, 2025

This PR sets up github actions to build and test this project.

It also adds a test for the failing test case mentioned in my issue #4

It seems that the github actions won't run in your repo until this goes to master, but you can see the runs here:
anisjonischkeit#1
https://github.com/anisjonischkeit/dynomark/actions/runs/14547924263/job/40815699107

Run go test -v ./...
=== RUN   TestMetadataQuery
    main_test.go:1[4](https://github.com/anisjonischkeit/dynomark/actions/runs/14547924263/job/40815699107#step:5:5): 
        LIST FROM "examples/" WHERE [author] IS Shakespeare
        is expected to output:
        - shakespeare_quotes.md
         Got 
        - movie_reviews.md
        - shakespeare_quotes.md
        - tasks.md
        - test.md
--- FAIL: TestMetadataQuery (0.00s)

@anisjonischkeit anisjonischkeit force-pushed the add-test-for-metadata-query branch from 2cf4bd2 to 65c4b5f Compare April 19, 2025 09:38
@k-lar
Copy link
Owner

k-lar commented Apr 22, 2025

Thanks for this PR! I wanted to add a bunch of tests after the 2.0 release but I never had the chance because I've been pretty busy lately. If this gets merged I would 100% add a ton of new tests to check for correct behavior.

As for the GitHub actions, I didn't think this was needed for a project of this scope but It can't hurt to have automated testing. I'll merge it if you can switch to a more lite linux distribution to make the build times faster (something like Alpine Linux?).

Meanwhile I'll work on fixing the actual issue #4, it'll probably be fixed either today or tomorrow (end of the week at the latest if everything goes wrong on my end).

@k-lar
Copy link
Owner

k-lar commented Apr 28, 2025

It's taking a bit longer than expected since I really can't find the time to work on this, but I would still like to merge this PR (if the distro for github actions is changed to something lightweight). I'll gradually start to add tests and when that happens, this PR would be harder to merge. If it's not changed in 5 days, I'll consider closing this PR and just adding the first tests myself (probably without github actions for now).

@anisjonischkeit
Copy link
Author

Sorry My bad, I totally forgot about this 😅. Any reason you'd like to switch to a more lightweight runner? It looks like we get a failing test in 17 seconds, seems like boot time isn't crazy there...

Unfortunately I have no experience with github actions so I'd need to go digging as to how to make it lighter, and I've got too many other things on that I likely won't get back to this too soon.

Do absolutely feel free to close this, the test was the important part, github action was just a bonus. By the way, I like this pattern you've got with your tests!

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