Browse Source

Add submodules to CI testing (#749)

* Add submodules to CI testing

* Forgot a quote

* Fixing tests
pull/750/head
dannylamb 5 years ago committed by Jared Whiklo
parent
commit
20477e814a
  1. 4
      .travis.yml
  2. 3
      modules/islandora_audio/config/schema/islandora_audio.schema.yml
  3. 1
      modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php
  4. 3
      modules/islandora_image/config/schema/islandora_image.schema.yml
  5. 1
      modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php
  6. 23
      modules/islandora_text_extraction/islandora_text_extraction.install
  7. 6
      modules/islandora_text_extraction/tests/src/Functional/LoadTest.php
  8. 3
      modules/islandora_video/config/schema/islandora_video.schema.yml
  9. 6
      modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php
  10. 4
      src/Form/IslandoraSettingsForm.php

4
.travis.yml

@ -38,6 +38,10 @@ script:
- $SCRIPT_DIR/travis_scripts.sh
- $SCRIPT_DIR/run-tests.sh "islandora"
- $SCRIPT_DIR/run-tests.sh "islandora_breadcrumbs"
- $SCRIPT_DIR/run-tests.sh "islandora_image"
- $SCRIPT_DIR/run-tests.sh "islandora_audio"
- $SCRIPT_DIR/run-tests.sh "islandora_video"
- $SCRIPT_DIR/run-tests.sh "islandora_text_extraction"
after_success:
- bash <(curl -s https://codecov.io/bash)

3
modules/islandora_audio/config/schema/islandora_audio.info.yml → modules/islandora_audio/config/schema/islandora_audio.schema.yml

@ -8,6 +8,9 @@ action.configuration.generate_audio_derivative:
event:
type: text
label: 'Event Type'
destination_media_type:
type: text
label: 'Destination media type'
source_term_uri:
type: text
label: 'Source term uri'

1
modules/islandora_audio/tests/src/Functional/GenerateAudioDerivativeTest.php

@ -46,6 +46,7 @@ class GenerateAudioDerivativeTest extends GenerateDerivativeTestBase {
$this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative");
$this->getSession()->getPage()->fillField('edit-id', "generate_audio_test_derivative");
$this->getSession()->getPage()->fillField('edit-queue', "generate-audio-test-derivative");
$this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label());
$this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label());
$this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label());
$this->getSession()->getPage()->fillField('edit-mimetype', "audio/mpeg");

3
modules/islandora_image/config/schema/islandora_image.info.yml → modules/islandora_image/config/schema/islandora_image.schema.yml

@ -8,6 +8,9 @@ action.configuration.generate_image_derivative:
event:
type: text
label: 'Event Type'
destination_media_type:
type: text
label: 'Destination media type'
source_term_uri:
type: text
label: 'Source term uri'

1
modules/islandora_image/tests/src/Functional/GenerateImageDerivativeTest.php

@ -48,6 +48,7 @@ class GenerateImageDerivativeTest extends GenerateDerivativeTestBase {
$this->getSession()->getPage()->fillField('edit-label', "Generate image test derivative");
$this->getSession()->getPage()->fillField('edit-id', "generate_image_test_derivative");
$this->getSession()->getPage()->fillField('edit-queue', "generate-image-test-derivative");
$this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label());
$this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label());
$this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label());
$this->getSession()->getPage()->fillField('edit-mimetype', "image/jpeg");

23
modules/islandora_text_extraction/islandora_text_extraction.install

@ -1,23 +0,0 @@
<?php
/**
* @file
* Install/update hook implementations.
*/
use Drupal\field\Entity\FieldConfig;
/**
* Implements hook_install().
*/
function islandora_text_extraction_install() {
// Add txt extension if it doesn't already exist;.
$field = FieldConfig::load("media.file.field_media_file");
$fieldSettings = $field->getSettings();
$extensions = $fieldSettings['file_extensions'];
if (!strpos($extensions, 'txt')) {
$fieldSettings['file_extensions'] .= ' txt';
$field->set('settings', $fieldSettings);
$field->save();
}
}

6
modules/islandora_text_extraction/tests/src/Functional/LoadTest.php

@ -3,14 +3,14 @@
namespace Drupal\Tests\islandora_text_extraction\Functional;
use Drupal\Core\Url;
use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\islandora\Functional\IslandoraFunctionalTestBase;
/**
* Simple test to ensure that main page loads with module enabled.
*
* @group islandora_text_extraction
*/
class LoadTest extends BrowserTestBase {
class LoadTest extends IslandoraFunctionalTestBase {
/**
* Modules to enable.
@ -29,7 +29,7 @@ class LoadTest extends BrowserTestBase {
/**
* {@inheritdoc}
*/
protected function setUp() {
public function setUp() {
parent::setUp();
$this->user = $this->drupalCreateUser(['administer site configuration']);
$this->drupalLogin($this->user);

3
modules/islandora_video/config/schema/islandora_video.info.yml → modules/islandora_video/config/schema/islandora_video.schema.yml

@ -8,6 +8,9 @@ action.configuration.generate_video_derivative:
event:
type: text
label: 'Event Type'
destination_media_type:
type: text
label: 'Destination media type'
source_term_uri:
type: text
label: 'Source term uri'

6
modules/islandora_video/tests/src/Functional/GenerateVideoDerivativeTest.php

@ -19,10 +19,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase {
/**
* @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::defaultConfiguration
* @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::buildConfigurationForm
* @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::defaultConfiguration
* @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::buildConfigurationForm
* @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::submitConfigurationForm
* @covers \Drupal\islandora\Plugin\Action\AbstractGenerateDerivative::execute
* @covers \Drupal\islandora_video\Plugin\Action\GenerateVideoDerivative::validateConfigurationForm
*/
public function testGenerateVideoDerivativeFromScratch() {
@ -46,6 +43,7 @@ class GenerateVideoDerivativeTest extends GenerateDerivativeTestBase {
$this->getSession()->getPage()->fillField('edit-label', "Generate video test derivative");
$this->getSession()->getPage()->fillField('edit-id', "generate_video_test_derivative");
$this->getSession()->getPage()->fillField('edit-queue', "generate-video-test-derivative");
$this->getSession()->getPage()->fillField('edit-destination-media-type', $this->testMediaType->label());
$this->getSession()->getPage()->fillField("edit-source-term", $this->preservationMasterTerm->label());
$this->getSession()->getPage()->fillField("edit-derivative-term", $this->serviceFileTerm->label());
$this->getSession()->getPage()->fillField('edit-mimetype', "video/mp4");

4
src/Form/IslandoraSettingsForm.php

@ -104,8 +104,8 @@ class IslandoraSettingsForm extends ConfigFormBase {
$form[self::FEDORA_URL] = [
'#type' => 'textfield',
'#title' => $this->t('Fedora URL'),
'#attributes' => array('readonly' => 'readonly'),
'#default_value' => t($fedora_url),
'#attributes' => ['readonly' => 'readonly'],
'#default_value' => $fedora_url,
];
$selected_bundles = $config->get(self::GEMINI_PSEUDO);

Loading…
Cancel
Save