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



# bitbucket inherited fixtures rails test
image: ruby:2.5

pipelines:
default:
- step:
caches:
- bundler
script: # Modify the commands below to build your repository.
- cd $BITBUCKET_CLONE_DIR
- 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
services:
- postgres
- redis
definitions:
services:
redis:
image: redis
postgres:
image: postgres
environment:
POSTGRES_DB: $db_name
POSTGRES_USER: $db_user
POSTGRES_PASSWORD: $db_password
caches:
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. 

Ex:

class SomeClass < ApplicationRecord

end



class SecondClass < SomeClass

end

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

 

Example:

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
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

4,010 views 4 22
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