-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add automatically-verified working examples #668
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #668 +/- ##
============================================
- Coverage 95.72% 95.31% -0.41%
- Complexity 1773 1809 +36
============================================
Files 154 171 +17
Lines 4586 4783 +197
============================================
+ Hits 4390 4559 +169
- Misses 196 224 +28 ☔ View full report in Codecov by Sentry. |
@shish I think this is a reasonable solution. However, it's not going to remain accurate unless there are tests for it. We should probably update the Another alternative would be adding a PHPUnit test that executes the examples. Edit: Glanced over your todo list - agreed. Let's prioritize the testing setup, as that'll help with assisting on feedback and contributions. |
Converted this to a draft until the TODO items are completed. |
fac2b9b
to
d7d3559
Compare
For reasons I am struggling to figure out, this runs fine on my dev machine but fails in github T_T
Local output:
Output when run on github:
Interestingly when I run the published [email protected] it works and [email protected] gives the same error as we see on github... |
Version 7 uses https://github.com/alekitto/class-finder, and |
Any idea what needs to change in the code to make it work? If you download this PR and run the test steps from the github action, does it work for you? Any idea why it works on my laptop but not on github? FYI, I don't have a "known-good" graphqlite setup that I can compare against, so I'm still not sure if my example code is even supposed to work the way it has been written - is it my code that's broken or something wrong with the framework? Without having a working example that I can compare against, I am debugging blind and I don't even know what direction I'm supposed to be going in 😓 (I'm not actually a graphqlite user, just somebody who found the docs so frustrating that it was easier to write my own schema-generator from scratch -- I would like to deprecate my own and use graphqlite, but I can't do that if I can't figure out why graphqlite isn't working, and it's hard to figure out why it's not working if there isn't a working example to compare against 😅 ) |
Having an example as actual code rather than as out-of-context snippets inside a text file means that we can run the code, and ensure that it actually works Submitting mostly for discussion to see if people like this idea TODO: - have a github action which runs the code and ensures that the "hello world" query works (thus ensuring that the example code is correct) - install graphqlite from parent folder instead of downloading the published 6.X (thus ensuring that the example is always in-sync with the library it is an example of) - update the documentation to reference the files in this repository, rather than embedding hard-coded out-of-context snippets into the .mdx files (thus ensuring that the documentation stays in-sync with the known-good example code)
67e72e1
to
521bce9
Compare
So that fixed the no-framework example, but it didn't fix the psr-15 example, which is having the same error T_T
The "automatically test examples as part of github actions" and "the no-framework example" are now working. Since the psr-15 example is broken for seemingly unrelated examples, I wonder if we could merge this PR as-is, and then rebase the other PR on top of it to try and debug what's wrong with that one? |
Add "no framework" example to examples folder
Having an example as actual code rather than as out-of-context snippets inside a text file means that we can run the code, and ensure that it actually works
Submitting mostly for discussion to see if people like this idea
TODO: