|
13 | 13 |
|
14 | 14 | describe 'create tags' do
|
15 | 15 | it 'creates all of the pacbio tag sets' do
|
16 |
| - Rake::Task['tags:create:pacbio_all'].invoke |
| 16 | + expect { Rake::Task['tags:create:pacbio_all'].invoke }.to output( |
| 17 | + <<~HEREDOC |
| 18 | + -> Creating Sequel_16_barcodes_v3 tag set and tags |
| 19 | + -> Tag Set successfully created |
| 20 | + -> Sequel_16_barcodes_v3 tags successfully created |
| 21 | + -> Creating Sequel_48_Microbial_Barcoded_OHA_v1tag set and tags |
| 22 | + -> Tag Set successfully created |
| 23 | + -> Sequel_48_Microbial_Barcoded_OHA_v1 tags successfully created |
| 24 | + -> Creating TruSeq_CD_i7_i5_D0x_8mer tag set and tags |
| 25 | + -> Tag Set successfully created |
| 26 | + -> TruSeq_CD_i7_i5_D0x_8mer tags successfully created |
| 27 | + -> Creating Sequel_96_Barcoded_OHA_v1 tag set and tags |
| 28 | + -> Tag Set successfully created |
| 29 | + -> Sequel_96_Barcoded_OHA_v1 tags successfully created |
| 30 | + -> Creating Pacbio IsoSeq tag set and tags |
| 31 | + -> Tag Set successfully created |
| 32 | + -> IsoSeq_Primers_12_Barcodes_v1 created |
| 33 | + -> Creating Nextera UD tag set and tags |
| 34 | + -> Tag Set successfully created |
| 35 | + -> Nextera_UD_Index_PlateA tags successfully created |
| 36 | + -> Creating Pacbio_96_barcode_plate_v3 tag set and tags |
| 37 | + -> Tag Set successfully created |
| 38 | + -> Pacbio_96_barcode_plate_v3 tags successfully created |
| 39 | + HEREDOC |
| 40 | + ).to_stdout |
17 | 41 | expect(TagSet.count).to eq(7)
|
18 | 42 | end
|
19 | 43 |
|
20 | 44 | it 'creates all of the ont tag sets' do
|
21 |
| - Rake::Task['tags:create:ont_all'].invoke |
| 45 | + expect { Rake::Task['tags:create:ont_all'].invoke }.to output( |
| 46 | + <<~HEREDOC |
| 47 | + -> Creating SQK-NBD114.96 tag set and tags |
| 48 | + -> Tag Set successfully created |
| 49 | + -> SQK-NBD114.96 tags successfully created |
| 50 | + HEREDOC |
| 51 | + ).to_stdout |
22 | 52 | expect(TagSet.count).to eq(1)
|
23 | 53 | end
|
24 | 54 |
|
25 | 55 | it 'creates all of the tag sets' do
|
26 | 56 | # We need to reenable all tag tasks because they have all already been invoked by this point
|
27 | 57 | Rake.application.in_namespace(:tags) { |namespace| namespace.tasks.each(&:reenable) }
|
28 |
| - Rake::Task['tags:create:traction_all'].invoke |
| 58 | + expect { Rake::Task['tags:create:traction_all'].invoke }.to output( |
| 59 | + <<~HEREDOC |
| 60 | + -> Creating Sequel_16_barcodes_v3 tag set and tags |
| 61 | + -> Tag Set successfully created |
| 62 | + -> Sequel_16_barcodes_v3 tags successfully created |
| 63 | + -> Creating Sequel_48_Microbial_Barcoded_OHA_v1tag set and tags |
| 64 | + -> Tag Set successfully created |
| 65 | + -> Sequel_48_Microbial_Barcoded_OHA_v1 tags successfully created |
| 66 | + -> Creating TruSeq_CD_i7_i5_D0x_8mer tag set and tags |
| 67 | + -> Tag Set successfully created |
| 68 | + -> TruSeq_CD_i7_i5_D0x_8mer tags successfully created |
| 69 | + -> Creating Sequel_96_Barcoded_OHA_v1 tag set and tags |
| 70 | + -> Tag Set successfully created |
| 71 | + -> Sequel_96_Barcoded_OHA_v1 tags successfully created |
| 72 | + -> Creating Pacbio IsoSeq tag set and tags |
| 73 | + -> Tag Set successfully created |
| 74 | + -> IsoSeq_Primers_12_Barcodes_v1 created |
| 75 | + -> Creating Nextera UD tag set and tags |
| 76 | + -> Tag Set successfully created |
| 77 | + -> Nextera_UD_Index_PlateA tags successfully created |
| 78 | + -> Creating Pacbio_96_barcode_plate_v3 tag set and tags |
| 79 | + -> Tag Set successfully created |
| 80 | + -> Pacbio_96_barcode_plate_v3 tags successfully created |
| 81 | + -> Creating SQK-NBD114.96 tag set and tags |
| 82 | + -> Tag Set successfully created |
| 83 | + -> SQK-NBD114.96 tags successfully created |
| 84 | + HEREDOC |
| 85 | + ).to_stdout |
29 | 86 | expect(TagSet.count).to eq(8)
|
30 | 87 | end
|
31 | 88 | end
|
|
40 | 97 | Rake::Task['tags:create:pacbio_isoseq'].reenable
|
41 | 98 | expect { Rake::Task['pacbio_data:create'].invoke }
|
42 | 99 | .to output(
|
43 |
| - "-> Creating Sequel_16_barcodes_v3 tag set and tags\n" \ |
44 |
| - "-> Tag Set successfully created\n" \ |
45 |
| - "-> Sequel_16_barcodes_v3 tags successfully created\n" \ |
46 |
| - "-> Creating Pacbio IsoSeq tag set and tags\n" \ |
47 |
| - "-> Tag Set successfully created\n" \ |
48 |
| - "-> IsoSeq_Primers_12_Barcodes_v1 created\n" \ |
49 |
| - "-> Creating pacbio plates and tubes...\b\b\b √ \n" \ |
50 |
| - "-> Creating pacbio libraries...\b\b\b √ \n" \ |
51 |
| - "-> Finding Pacbio SMRT Link versions...\b\b\b √ \n" \ |
52 |
| - "-> Creating pacbio runs:\n " \ |
53 |
| - "-> Creating runs for v11...\b\b\b √ \n " \ |
54 |
| - "-> Creating runs for v12_revio...\b\b\b √ \n" \ |
55 |
| - "-> Pacbio runs successfully created\n" |
| 100 | + <<~HEREDOC |
| 101 | + -> Creating Sequel_16_barcodes_v3 tag set and tags |
| 102 | + -> Tag Set successfully created |
| 103 | + -> Sequel_16_barcodes_v3 tags successfully created |
| 104 | + -> Creating Pacbio IsoSeq tag set and tags |
| 105 | + -> Tag Set successfully created |
| 106 | + -> IsoSeq_Primers_12_Barcodes_v1 created |
| 107 | + -> Creating pacbio plates and tubes...\b\b\b √#{' '} |
| 108 | + -> Creating pacbio libraries...\b\b\b √#{' '} |
| 109 | + -> Finding Pacbio SMRT Link versions...\b\b\b √#{' '} |
| 110 | + -> Creating pacbio runs: |
| 111 | + -> Creating runs for v11...\b\b\b √#{' '} |
| 112 | + -> Creating runs for v12_revio...\b\b\b √#{' '} |
| 113 | + -> Pacbio runs successfully created |
| 114 | + HEREDOC |
56 | 115 | ).to_stdout
|
57 | 116 | expect(Pacbio::Run.count)
|
58 | 117 | .to eq(12)
|
|
61 | 120 |
|
62 | 121 | describe 'library_types:create' do
|
63 | 122 | it 'creates the library types' do
|
64 |
| - expect { Rake::Task['library_types:create'].invoke }.to change(LibraryType, :count).by(15).and output("-> Library types updated\n").to_stdout |
| 123 | + expect { Rake::Task['library_types:create'].invoke }.to change(LibraryType, :count).by(15).and output( |
| 124 | + <<~HEREDOC |
| 125 | + -> Library types updated |
| 126 | + HEREDOC |
| 127 | + ).to_stdout |
65 | 128 | end
|
66 | 129 | end
|
67 | 130 |
|
68 | 131 | describe 'data_types:create' do
|
69 | 132 | it 'creates the data types' do
|
70 |
| - expect { Rake::Task['data_types:create'].invoke }.to change(DataType, :count).by(2).and output("-> Data types updated\n").to_stdout |
| 133 | + expect { Rake::Task['data_types:create'].invoke }.to change(DataType, :count).by(2).and output( |
| 134 | + <<~HEREDOC |
| 135 | + -> Data types updated |
| 136 | + HEREDOC |
| 137 | + ).to_stdout |
71 | 138 | end
|
72 | 139 | end
|
73 | 140 |
|
74 | 141 | describe 'ont_instruments:create' do
|
75 | 142 | it 'creates the correct instrument data' do
|
76 | 143 | Rake::Task['ont_instruments:create'].reenable
|
77 |
| - expect { Rake::Task['ont_instruments:create'].invoke }.to change(Ont::Instrument, :count).and output("-> ONT Instruments successfully created\n").to_stdout |
| 144 | + expect { Rake::Task['ont_instruments:create'].invoke }.to change(Ont::Instrument, :count).and output( |
| 145 | + <<~HEREDOC |
| 146 | + -> ONT Instruments successfully created |
| 147 | + HEREDOC |
| 148 | + ).to_stdout |
78 | 149 | end
|
79 | 150 | end
|
80 | 151 |
|
81 | 152 | describe 'min_know_versions:create' do
|
82 | 153 | it 'creates the correct MinKnowVersion data' do
|
83 |
| - expect { Rake::Task['min_know_versions:create'].invoke }.to change(Ont::MinKnowVersion, :count).and output("-> ONT MinKnow versions successfully created\n").to_stdout |
| 154 | + expect { Rake::Task['min_know_versions:create'].invoke }.to change(Ont::MinKnowVersion, :count).and output( |
| 155 | + <<~HEREDOC |
| 156 | + -> ONT MinKnow versions successfully created |
| 157 | + HEREDOC |
| 158 | + ).to_stdout |
84 | 159 | end
|
85 | 160 | end
|
86 | 161 |
|
|
150 | 225 |
|
151 | 226 | it 'modifies the data correctly' do
|
152 | 227 | expect(Pacbio::Well.count).to eq(6) # create(:pacbio_plate) also creates a well
|
153 |
| - Rake::Task['pacbio_wells:migrate_smrt_link_options'].invoke |
| 228 | + expect { Rake::Task['pacbio_wells:migrate_smrt_link_options'].invoke }.to output( |
| 229 | + <<~HEREDOC |
| 230 | + -> 6 instances of pacbio well updated. |
| 231 | + HEREDOC |
| 232 | + ).to_stdout |
154 | 233 | [well1, well2, well3, well4, well5].collect(&:reload)
|
155 | 234 | expect(well1.generate_hifi).to eq('In SMRT Link')
|
156 | 235 | expect(well2.generate_hifi).to eq('On Instrument')
|
|
162 | 241 |
|
163 | 242 | describe 'qc_assay_types:create' do
|
164 | 243 | it 'creates the correct number of qc assay types' do
|
165 |
| - expect { Rake::Task['qc_assay_types:create'].invoke }.to change(QcAssayType, :count).by(10).and output("-> QC Assay Types updated\n").to_stdout |
| 244 | + expect { Rake::Task['qc_assay_types:create'].invoke }.to change(QcAssayType, :count).by(10).and output( |
| 245 | + <<~HEREDOC |
| 246 | + -> QC Assay Types updated |
| 247 | + HEREDOC |
| 248 | + ).to_stdout |
166 | 249 | end
|
167 | 250 | end
|
168 | 251 |
|
|
191 | 274 | # Reenabling the task makes it possible to invoke again.
|
192 | 275 | # Invoke the data migration task for smrt_link options.
|
193 | 276 | Rake::Task['pacbio_wells:migrate_smrt_link_options'].reenable
|
194 |
| - Rake::Task['pacbio_wells:migrate_smrt_link_options'].invoke |
| 277 | + expect { Rake::Task['pacbio_wells:migrate_smrt_link_options'].invoke }.to output( |
| 278 | + <<~HEREDOC |
| 279 | + -> 2 instances of pacbio well updated. |
| 280 | + HEREDOC |
| 281 | + ).to_stdout |
195 | 282 |
|
196 | 283 | # Reload the attributes of the record from the database.
|
197 | 284 | # We want to see what was saved by the task.
|
|
208 | 295 | describe 'migrate_pacbio_run_smrt_link_versions' do
|
209 | 296 | it 'creates smrt link version and options for v10' do
|
210 | 297 | Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].reenable
|
211 |
| - Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].invoke |
| 298 | + expect do |
| 299 | + Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].invoke |
| 300 | + end.to output( |
| 301 | + <<~HEREDOC |
| 302 | + -> Pacbio SMRT Link versions and options successfully created |
| 303 | + HEREDOC |
| 304 | + ).to_stdout |
212 | 305 |
|
213 | 306 | version = Pacbio::SmrtLinkVersion.find_by(name: 'v10', default: true, active: true)
|
214 | 307 | expect(version).not_to be_nil
|
|
294 | 387 |
|
295 | 388 | Rake::Task['smrt_link_versions:create'].reenable
|
296 | 389 | Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].reenable
|
297 |
| - Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].invoke |
| 390 | + expect { Rake::Task['pacbio_runs:migrate_pacbio_run_smrt_link_versions'].invoke }.to output( |
| 391 | + <<~HEREDOC |
| 392 | + -> Pacbio SMRT Link versions and options successfully created |
| 393 | + HEREDOC |
| 394 | + ).to_stdout |
298 | 395 |
|
299 | 396 | run10.reload
|
300 | 397 | run11.reload
|
|
0 commit comments