Replies: 2 comments
-
Yes, that's the idea. feel free to pull the repo and run locally, the test code is generated and the tests themselves are generated. on the CI machine, the generated test code gets picked up but the real code doesn't seem to recognized on the CI runner. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Generated controllers not picked up
Body
I'm trying to do something a little non-standard on Github actions.
In particular, my Gem code is being tested for its ability to generate code (it is a code generator). once it generates code & tests, it then runs the newly generated tests against the newly generated code.
It is fully open-source so you can examine the test suite here:
https://github.com/hot-glue-for-rails/hot-glue/blob/main/script/test
This is accomplished using the gem itself:
rails generate hot_glue:scaffold Abc --gd
this command generates code directly:
After the code is generated, I run
rspec
to run the generated spec (in the example above, createspec/dummy/spec/features/abcs_behavior_spec.rb
). The generated spec is testing the generated code, of course.Locally, it works fine, but on GH actions, what I'm seeing is that GItHub CI appears not load the generated code when I run
rspec
It starts the test run and then tells me it it can't load the AbcController. NOtice that it does load the spec and tell tries to load a GET URL— this test was generated, and it is testing the generated controller
What's interesting to me is that the generated test must be loading — or else it wouldn't be running the test at all— so the generated code must be there. But then it crashes saying it can't find the controller
AbcsController
, so I suspect that somehow on GH actions it doesn't know how to re-load the code correctly.Locally it works fine and all the tests pass.
Note that this test suite is for system tests, do not confuse with the other (internal) rspec suite you see in the gem code (which passes fine on Github CI)
https://github.com/hot-glue-for-rails/hot-glue/blob/main/script/test
Beta Was this translation helpful? Give feedback.
All reactions