Skip to content

use git submodules for bats-* instead of globally installed brew packages #36

Closed
@hanoii

Description

@hanoii

In working on ddev/ddev-drupal-contrib#85 I wanted to use bats-support and bats-assert.

I started wondering how to use them.

I am on mac and with brew info kaos/shell/bats-assert

I get

To load the bats-assert lib in your bats test:

    load '/opt/homebrew/lib/bats-support/load.bash'
    load '/opt/homebrew/lib/bats-assert/load.bash'

Ok there. Because this action uses homebrew for linux as well, I'd assume this might work, however, it is still a bit dependent on the system, and a bit cryptic, so I was thinking on a potentially better alternative:

Use git submodules: https://bats-core.readthedocs.io/en/stable/tutorial.html#quick-installation

I am not 100% sure of the implications, but I think very little, from what I gather:

  • the documentation for setting up tests on https://github.com/ddev/ddev-addon-template needs to be updated, namely one would have to manually run git submodules init
  • This action needs to add submodules: true to the checkout action
  • In order to provide backwards compatibility, bats should still be installed globally by this action, but maybe check for a bats-core submodule somehow, this can be as simple as adding ./tests/bats/bin to the path or something more complex using git submodule commands or parsing of .gitmodules

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions