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 fullstack
tag for system specs
#30144
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I think this is a sensible approach. I'm curious if the extra setup for fullstack tests would cause issues for non-fullstack tests. i.e. can you do bundle exec rspec --tag fullstack
and have it run all the tests without issues?
There currently are test failures on the CI, but I haven't investigated them.
Good question ... we'd have to look at both using the JS-browser for the previous system specs that use rack_test and see if they are ok under selenium (they were NOT on my quick initial checks in a previous PR); and we'd also have to look at whether having the streaming server running and connected in the background impacts those or any other specs as well. I haven't thoroughly looked at this, other than that initial check.
Yeah there's definitely some issue here. It's a little hard because we do have those intermittent failures across the selenium-driven system specs already ... but I'm also seeing these as intermittent local failures more so in this PR branch than regularly, and with different failures, so there's probably something going on from this branch. I'll work on that a bit. Separately, for me locally, the oauth spec specifically always fails entirely. Not sure if there's a mac/linux issue where it fails for me and passes CI, or some other env/config thing I've got going where I don't realize the difference. |
9ecaf71
to
5aced5e
Compare
Think I worked out the flaky specs aspect ... I had forgotten to change the db cleaner config in a place it needed to be changed, and changed it in a place it did not need changing. Adjusted that, things passing now. Still looking at other stuff. |
96761da
to
a50c931
Compare
I do appreciate the switch from an environment variable to a tag, but taking a step back, I find a sub-directory ( Are you aware of any established convention around that in other Rails project? |
I also think it's weird, but added it here based on prior guidance.
In 99% of every (recent-ish) Rails project I've looked at, the convention is to put all the system specs into The only special case we have on top of that is the spinning up/down of the streaming server via that manager class. |
Trying to sum up my thoughts about all this:
|
Also, on an adjacent topic, I only just now noticed the |
Great, agreed.
I think what you described is the most typical and intended way to do this ... use tags at the appropriate level (whole file, just a context, just one example, etc) to describe the features you want on/off/changed/whatever. We do this already for the paperclip processing and sidekiq behavior; so also doing it for the "I need a streaming server running" and "I need to use a JS browser" use cases feel normal to me. I tried this in a previous PR that was rejected. With the appropriate tagging in place, you can then configure what should run by default (while preserving ability to run full) and what should only run on CI and so on. Part of what I think might feel odd here is that since we currently have this hard separation by directory breaking that seems weird ... but in some hypothetical future when we migrate some of the current controller specs to become system specs, and ideally add many more new ones for some of the JS-requiring features it will not seem weird. My own side note - I think it makes sense to use dirs for things like "admin", kind of like we have in the api request specs and in the controller specs now ... basically have it mirror either the actual primary code organization or some app-level concept; rather than for feature enabled/disable (which like you noted, is better done with tags). |
Let's say we change current |
Putting aside whatever env vars or other config, I think the CI command would just be like |
But it would also run every other test, right? |
If I understand the question, then yes it would still run everything on CI. What I was envisioning on CI was to preserve the current approach:
For local dev, you'd have the same default behavior of excluding the defaults, but could opt in with the tags if desired. If that was not what you meant ... then I don't know what you meant. |
Sorry, I misunderstood how |
Should I reformulate this into one that includes both the file dir consolidation and the tag approach into another PR and we can review that? |
What do you mean by the file dir consolidation? |
Moving the system specs which are currently in I could probably start a branch from this PR's branch, and keep the file moves, but replace the |
Yeah, sounds like a plan to me! |
a50c931
to
6b644b4
Compare
Added #30206 -- I like the approach done there (new PR) better, but will leave this open until both can be reviewed. |
This pull request has merge conflicts that must be resolved before it can be merged. |
Closing in favor of #30206 |
This is sort of a followup on a bunch of previous PRs:
As noted in comments across those, I had a few spec coverage goals that are blocked by the current configuration of system specs:
Previous efforts have been rejected for various naming/terminology/organizational reasons. This one takes a slightly different approach to hopefully handle the issues from the prior ones. Summary of changes:
spec/features/
tospec/system/
. This is very much a naming-only move to align with where current rspec/rails versions put things (misc reading: 1, 2, 3)spec/system/
intospec/system/fullstack/
as a way of isolating them from the others (to enable next bullet...):fullstack
tag to all spec files in that directory.rack_test
as the default driver for system specs; and to use the configuredCapybara.javascript_driver
(currently headless chrome) for examples with that:fullstack
tag.Curious to get feedback on this direction, will leave a few inline comments re: future ideas.