GithubHelp home page GithubHelp logo

Comments (5)

subhojit777 avatar subhojit777 commented on June 3, 2024 1

@szeidler I did like this https://github.com/subhojit777/listjs/blob/7.x-1.x/tests/behat.yml#L39 and asked Travis to run the specific profile like this https://github.com/subhojit777/listjs/blob/7.x-1.x/.travis.yml#L51

from drupal_ti.

LionsAd avatar LionsAd commented on June 3, 2024

There is several things mixed here:

a) The easiest solution likely is just to source your script with parameters:

- . behat-params.sh

or

- source ./behat-params.sh

That will ensure that environment variables are exported correctly.

b) You can set all those behat parameters already in a custom behat.yml.dist file including placeholders for all environment variables, see the test behat test in the drupal-7 / drupal-8 test directories:

https://github.com/LionsAd/drupal_ti/blob/master/tests/drupal-7/drupal_ti_test/tests/behat/behat.yml.dist

c) When you want to use the before or after functionality you can run in the same environment as the runner you want to extend, there is no need to --include that:

- DRUPAL_TI_SCRIPT_DIR_BEFORE="./drupal_ti/before"

You need to uncomment that in your .travis.yml, then it will automatically find e.g. drupal_ti/before/runners/behat/script.sh and you can set environment variables there.

Hope that helps! :)

from drupal_ti.

subhojit777 avatar subhojit777 commented on June 3, 2024

Thanks! I missed the behat.yml.dist in the README. That really helped and it is working.

BTW I have another confusion regarding the "before" script. You have asked to uncomment this:

- DRUPAL_TI_SCRIPT_DIR_BEFORE="./drupal_ti/before"

But it seems like it is not considering the scripts. Where do I have to put this drupal_ti directory. Currently it is placed just under my module's directory like this:

mymodule
  - tests/
  - drupal_ti/
  - mymodule.info
  - mymodule.module

I have also tried placing drupal_ti under tests directory, and changed DRUPAL_TI_SCRIPT_DIR_BEFORE this to:

- DRUPAL_TI_SCRIPT_DIR_BEFORE="./tests/drupal_ti/before"

But it is still not working. Only option to make it work is "including" it under before_script. Am I doing something wrong?

from drupal_ti.

subhojit777 avatar subhojit777 commented on June 3, 2024

Inside before_script.sh:

#!/bin/bash

# Add an optional statement to see that this is running in Travis CI.
echo "running drupal_ti/before/before_script.sh"

set -e $DRUPAL_TI_DEBUG

# Install list.js library.
cd "$DRUPAL_TI_DRUPAL_DIR/$DRUPAL_TI_LIBRARIES_DIR"
wget "https://github.com/javve/list.js/archive/v$DRUPAL_TI_LISTJS_VERSION.tar.gz"
tar -xzf "v$DRUPAL_TI_LISTJS_VERSION.tar.gz"
mv "list.js-$DRUPAL_TI_LISTJS_VERSION" "listjs"

# Enable required modules.
drush en -y "features"
drush en -y "views"
drush en -y "views_ui"

from drupal_ti.

szeidler avatar szeidler commented on June 3, 2024

Thanks for the awesome project.

I'm struggling with the same issue as @subhojit777. I cannot make the autodiscovery work when using DRUPAL_TI_SCRIPT_DIR_BEFORE.

I defined - DRUPAL_TI_SCRIPT_DIR_BEFORE="./tests/drupal_ti/before"
and have the script placed in tests/drupal_ti/before/runners/behat/before_script.sh. But it's not taken into account.

Do you have any suggestions?

from drupal_ti.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.