Super noobish question (and not specifically about...
# support
g
Super noobish question (and not specifically about Solidus, so if I should ask in another channel I'll move it, but I figured it was for a solidus gem and I could justify it tangentially)... Usually when we make personalized changes to gems we just fork and use our own version. In the spirit of hacktoberfest we're trying to actually submit pr's on some of the things that might actually be useful to others, buuuuut the thing that we're running into is that we're still relatively new to ruby and have some bad habits carrying over from other languages... such as not testing... so we don't know how to run tests on the gems that we've made changes to. (I know I know, it's terrible, but we're trying to get better) The one specifically that I'm trying to test is for solidus_zip_zones, and I think I've followed the directions for testing in
.readme
, but I must be missing some context because I'm trying to write tests that intentionally fail (to make sure I get how the logic works), and what I'm getting back from
bundle exec rake
is
Copy code
Running via Spring preloader in process 5271
Run options: --seed 16060

# Running:

Finished in 1.732592s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
So it looks like I'm either just not getting how tests should be written or how they should be run. Or both, I guess. Can anybody point me in a direction for how to make sure I get a test written and tested? Especially if I promise that once we figure it out we'll start doing it more often? 😄
j
Are the tests running on CircleCI? Often the CI configuration is a good way to figure out how to run the tests for a project.
g
Is that something that we have to set up somewhere? As far as I know we haven't set up any automated testing. At this point I was just trying to run the test manually to make sure it passed. I'll look into CircleCI and see if that's something we can get running in our workflow
j
When extensions are generated they come with a circle ci config.
g
Is there a way to run tests locally before I commit and CircleCI does its thing? Since I'm new to testing I'd like to debug my tests before I commit anything.
j
yeah, for sure
I'm just suggesting looking at the CI config to get an idea on how to run them locally
g
oh gotcha gotcha, ok, I'll dig into the CI config for my next steps, thanks!
j
I'm realizing there's some indirection with how the Circle config works... so maybe not the most helpful suggestion.
g
lol, ok
j
bunde exec rake
should be the right command though
g
I think I'm realizing what I'm doing wrong, and the issue is with how I'm doing the changes. I was making tweaks on a project that's using that gem, and our fork is just pulled and I've been updating files from there. I don't have an environment with
solidus_dev_support
set up. I'm thinking I should probably do that first.
sg thumbs up 1
Yep, that's all I needed... I'm so used to just editing files in a repo, I didn't have an actual dev environment set up. Once I went through the "creating an extension" stuff and pulled in my repo I was able to run the tests as expected. Thanks for the time, I appreciate it 😄
sg horns 1