Skip to content

Commit 47d8fa4

Browse files
committed
Seed ProcessedExpressionDataVectorCreationHelperServiceTest to prevent random CI failures
1 parent 77141f2 commit 47d8fa4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

gemma-core/src/test/java/ubic/gemma/persistence/service/expression/bioAssayData/ProcessedExpressionDataVectorCreationHelperServiceTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import static org.junit.Assert.assertEquals;
3232
import static org.junit.Assert.assertTrue;
3333
import static ubic.gemma.persistence.service.expression.bioAssayData.RandomExpressionDataMatrixUtils.randomExpressionMatrix;
34+
import static ubic.gemma.persistence.service.expression.bioAssayData.RandomExpressionDataMatrixUtils.setSeed;
3435

3536
public class ProcessedExpressionDataVectorCreationHelperServiceTest extends BaseIntegrationTest {
3637

@@ -51,6 +52,7 @@ public class ProcessedExpressionDataVectorCreationHelperServiceTest extends Base
5152

5253
@Test
5354
public void testCreateProcessedDataVectors() throws QuantitationTypeDetectionException, QuantitationTypeConversionException {
55+
setSeed( 123L );
5456
double[][] matrix = randomExpressionMatrix( NUM_PROBES, 4, new LogNormalDistribution( 9, 1 ) );
5557
ExpressionExperiment ee = getTestExpressionExperimentForRawExpressionMatrix( matrix, ScaleType.LINEAR, false );
5658
assertThat( ee.getProcessedExpressionDataVectors() ).isEmpty();
@@ -73,6 +75,7 @@ public void testCreateProcessedDataVectors() throws QuantitationTypeDetectionExc
7375

7476
@Test
7577
public void testCreateProcessedDataVectorsFromLog2Data() throws QuantitationTypeDetectionException, QuantitationTypeConversionException {
78+
setSeed( 123L );
7679
double[][] matrix = randomExpressionMatrix( NUM_PROBES, 4, new NormalDistribution( 15, 1 ) );
7780
ExpressionExperiment ee = getTestExpressionExperimentForRawExpressionMatrix( matrix, ScaleType.LOG2, false );
7881
assertThat( ee.getProcessedExpressionDataVectors() ).isEmpty();
@@ -95,6 +98,7 @@ public void testCreateProcessedDataVectorsFromLog2RatiometricData() throws Quant
9598

9699
@Test
97100
public void testThaw() throws QuantitationTypeDetectionException, QuantitationTypeConversionException {
101+
setSeed( 123L );
98102
double[][] matrix = randomExpressionMatrix( NUM_PROBES, 8, new NormalDistribution( 0, 1 ) );
99103
ExpressionExperiment ee = getTestExpressionExperimentForRawExpressionMatrix( matrix, ScaleType.LOG2, true );
100104
assertThat( ee.getRawExpressionDataVectors() ).hasSize( NUM_PROBES );

0 commit comments

Comments
 (0)