It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Ruby tests failing in pipeline for inherited fixture sets. Edited

Brett Mahnke I'm New Here Apr 03, 2019

# bitbucket inherited fixtures rails test
image: ruby:2.5

- step:
- bundler
script: # Modify the commands below to build your repository.
- apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs ruby-dev libidn11 libidn11-dev yarn
- echo "bundle install"
- bundle install --path vender/bundle
- echo "migrate/seed/test"
- rake db:migrate RAILS_ENV=test
- rake test RAILS_ENV=test
- postgres
- redis
image: redis
image: postgres
POSTGRES_DB: $db_name
bundler: vendor/bundle

 Above is my pipeline file. 


When the pipeline runs after a commit to the master branch, any test that references a fixture, that deals with a model that extends a different model, they fail. 


class SomeClass < ApplicationRecord


class SecondClass < SomeClass


So, any test that is trying to find a fixture set in via the active record helper in tests fails:



Here, I'm trying to make an instance variable named second, by trying to find a SecondClass record, named some_record. This will fail the find the record, and there will be an error thrown in the pipeline output.

second = second_classes(:some_record)

Why is this? Or, how can ensure my tests pass in the Bitbucket Pipeline? They all pass locally.

0 answers

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,570 views 1 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you