Project

General

Profile

Patch #41954 » test_extract_fixture_with_time_offset.sh

Ko Nagase, 2024-12-09 09:42

 
1
#!/bin/bash
2
set -eux
3

    
4
adapter=$1
5
time_offset=""
6
if [ "$#" -eq 2 ]; then
7
  time_offset=$2
8
fi
9

    
10
# Load test fixtures
11
bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && \
12
  bundle exec rake db:fixtures:load
13

    
14
# Save fixtures (1st)
15
bundle exec rake extract_fixtures DIR=./tmp/fixtures/$adapter-1 TIME_OFFSET=$time_offset
16

    
17
# Load saved fixtures
18
bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && \
19
  bundle exec rake db:fixtures:load FIXTURES_PATH=./tmp/fixtures/$adapter-1
20

    
21
# Save fixtures (2nd)
22
bundle exec rake extract_fixtures DIR=./tmp/fixtures/$adapter-2 TIME_OFFSET=$time_offset
23

    
24
# Check diff
25
diff -u ./tmp/fixtures/$adapter-1 ./tmp/fixtures/$adapter-2
(7-7/10)