Skip to content
Snippets Groups Projects
user avatar
[ENSCORESW-443]. Added test to check presence of foreign key constraints
Alessandro Vullo authored
493d2d39
Name Last commit Last update
..
test-genome-DBs
.cvsignore
MultiTestDB.conf.default
MultiTestDB.conf.example
MultiTestDB.t
README
analysis.t
archiveStableId.t
argument.t
assemblyException.t
assemblyExceptionFeature.t
assemblyMapper.t
attribute.t
attributeAdaptor.t
baseAdaptor.t
canonicalDBAdaptor.t
chainedAssemblyMapper.t
circularSlice.t
compressedSequenceAdaptor.t
coordSystem.t
coordSystemAdaptor.t
dataFile.t
dbConnection.t
dbEntries.t
densityFeature.t
densityFeatureAdaptor.t
densityType.t
densityTypeAdaptor.t
dependencies.t
ditag.t
ditagAdaptor.t
ditagFeature.t
ditagFeatureAdaptor.t
dnaAlignFeatureAdaptor.t
dnaDnaAlignFeature.t
dnaPepAlignFeature.t
easyargv.t
exception.t
exon.t
externalFeatureAdaptor.t
fastaSerializer.t
feature.t
featurePair.t
fullIdCaching.t
gene.t
geneview.t
gffParser.t
gffSerialiser.t
intron.t
intronSupportingEvidence.t
iterator.t
karyotypeBand.t
karyotypeBandAdaptor.t
lruIdCaching.t
mapLocation.t
mapper.t
marker.t
markerAdaptor.t
markerFeature.t
markerFeatureAdaptor.t
markerSynonym.t
metaContainer.t
metaCoordContainer.t
miscFeature.t
miscFeatureAdaptor.t
miscSet.t
miscSetAdaptor.t
objectLoad.t
ontologyTerm.t
operon.t
operon_fetch.t
operon_transcript.t
paddedSlice.t
predictionTranscript.t
proteinAlignFeatureAdaptor.t
proteinFeature.t
proteinFeatureAdaptor.t
qtl.t
rangeRegistry.t
registry.t
regression_baseFeatureAdaptorMultiQuery.t
regression_featureAdaptorCache.t
regression_transcriptProjectionAttributeDuplication.t
repeatConsensus.t
repeatConsensusAdaptor.t
repeatFeature.t
repeatFeatureAdaptor.t
repeatMaskedSlice.t
schema.t
schemaPatches.t
seqDumper.t
seqEdit.t
sequenceAdaptor.t
simpleFeature.t
slice.t
sliceAdaptor.t
sqlHelper.t
subSliceFeature.t
topLevelAssemblyMapper.t
transcript.t
    This directory contains a set of  tests for the Ensembl API modules.
    The test_genome.zip  file contains the set  of data that is  used by
    the tests.

    The test  system requires some modules  which are in a  seperate CVS
    module ensembl-test.  To use the tests you must add the ensembl-test
    modules to your PERL5LIB environment variable.

    Example (for tcsh or csh):

      setenv PERL5LIB ${PERL5LIB}:${ENSHOME}/ensembl-test/modules

    Example (for ksh or bash):

      export PERL5LIB=${PERL5LIB}:${ENSHOME}/ensembl-test/modules

    This  is assuming  ENSHOME  is  the directory  into  which you  have
    checked out your CVS source trees.

    In  order to  run the  tests  you must  create a  t/MultiTestDB.conf
    file  with connection  details (username,  host, etc.)  for a  MySQL
    instance where  you have  write permission.   An example  file named
    MultiTestDB.conf.example is  included in the /t  directory.  Running
    test case(s) which require a  database will automatically create and
    remove a temporary database during the test(s) execution.

    To run  multiple tests at once  use the runtests.pl script  which is
    found in  the ensembl-test/scripts directory.   It may be  useful to
    add  this directory  to  your path.   To run  a  single test  simply
    execute the *.t file:

    Examples:

      # run all tests in the t directory
      runtests.pl t

      # run 3 tests
      runtests.pl t/gene.t t/exon.t t/densityFeature.t

      # run a single test
      perl t/gene.t

    If you need  to modify the schema  of the database and  dump the new
    table structure and  data before commiting to CVS,  the quickest way
    to do it is:

    Example: we want to dump the external_db table

      # to dump the table structure, without headers or any
      # additional MySQL specific information
      mysqldump -d --compact \
        -h ens-research -u ensro \
        my_database external_db > external_db.sql

      # to dump the data in a tab delimited file format and
      # replacing "NULL" with "\N".
      mysql -BN \
        -e 'select * from external_db' \
        -h ens-research -u ensro \
        my_database | sed 's/NULL/\\N/g' > external_db.txt

    The  two  files  that  are   created,  (in  the  above  example  are
    external_db.sql and external_db.txt) are the  ones that will have to
    be committed to CVS under

      ensembl/modules/t/test-genome-DBs/homo_sapiens/core/

    This way to  dump data is only suitable for  small tables, (like the
    ones in the  unit tests).  For bigger tables, you  might need to use
    the standard mysqldump.