Skip to content

Commit

Permalink
Merge branch '2.x' of https://github.com/tripal/tripal_blast into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
laceysanderson committed Mar 30, 2024
2 parents d0adfad + 03fa62b commit 5d73010
Show file tree
Hide file tree
Showing 16 changed files with 541 additions and 8 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ALL-PHPUnit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@

name: PHPUnit
on: [push]

env:
PKG_NAME: tripal_blast
MODULES: "tripal_blast"

jobs:
run-tests:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
- "8.1"
pgsql-version:
- "13"
drupal-version:
- "9.3.x-dev"
- "9.4.x-dev"
- "9.5.x-dev"
# - "10.0.x-dev"
# exclude:
# - php-version: "8.0"
# pgsql-version: "13"
# drupal-version: "10.0.x-dev"

steps:
# Check out the repo
- name: Checkout Repository
uses: actions/checkout@v3
# Here we pull the development tripaldocker image for this combo in our matrix
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: $PKG_NAME
modules: $MODULES
php-version: ${{ matrix.php-version }}
pgsql-version: ${{ matrix.pgsql-version }}
drupal-version: ${{ matrix.drupal-version }}
74 changes: 74 additions & 0 deletions .github/workflows/ALL-testCoverage-codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Run some PHPUnit tests
name: Test Coverage
on: [push]

env:
PKG_NAME: tripal_blast
MODULES: "tripal_blast"
IMAGE_TAG: drupal9.5.x-dev-php8.1-pgsql13
SIMPLETEST_BASE_URL: "http://localhost"
SIMPLETEST_DB: "pgsql://drupaladmin:drupal9developmentonlylocal@localhost/sitedb"
BROWSER_OUTPUT_DIRECTORY: "/var/www/drupal9/web/sites/default/files/simpletest"

jobs:
# Job 1: 'build'
run-tests:
# Runner type
runs-on: ubuntu-latest
name: Test Coverage

steps:
# Check out the repo
- name: Checkout Repository
uses: actions/checkout@v3
# Here we pull the development tripaldocker image for this combo in our matrix
- name: Pull TripalDocker Image
run: |
docker pull tripalproject/tripaldocker:$IMAGE_TAG
# Just spin up docker the good ol' fashion way
# mounting our currently checked out package inside the docker container.
- name: Spin up Docker locally
run: |
docker run --publish=80:80 --name=tripaldocker -tid \
--volume=`pwd`:/var/www/drupal9/web/modules/contrib/$PKG_NAME tripalproject/tripaldocker:$IMAGE_TAG
# Install the modules
- name: Install our package in Docker
run: |
docker exec tripaldocker service postgresql restart
docker exec tripaldocker drush en $MODULES --yes
# Ensure we have the variables we need.
- name: Inject slug/short variables
uses: rlespinasse/[email protected]
# Prepare for code coverage.
- name: Prepare for Code Coverage
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
docker cp cc-test-reporter tripaldocker:/var/www/drupal9/web/modules/contrib/$PKG_NAME
docker exec tripaldocker chmod a+x /var/www/drupal9/web/modules/contrib/$PKG_NAME/cc-test-reporter
docker exec --workdir=/var/www/drupal9/web/modules/contrib/$PKG_NAME tripaldocker ./cc-test-reporter before-build --debug
# Runs the PHPUnit tests.
# https://github.com/mheap/phpunit-github-actions-printer is used
# to report PHPUnit fails in a meaningful way to github in PRs.
# Stopped using mheap due to warning w/ phpunit8->9
- name: Run Tests for Coverage
env:
SIMPLETEST_BASE_URL: "http://localhost"
SIMPLETEST_DB: "pgsql://drupaladmin:drupal9developmentonlylocal@localhost/sitedb"
BROWSER_OUTPUT_DIRECTORY: "/var/www/drupal9/web/sites/default/files/simpletest"
run: |
docker exec tripaldocker service postgresql restart
docker exec -e SIMPLETEST_BASE_URL=$SIMPLETEST_BASE_URL \
-e SIMPLETEST_DB=$SIMPLETEST_DB \
-e BROWSER_OUTPUT_DIRECTORY=$BROWSER_OUTPUT_DIRECTORY \
--workdir=/var/www/drupal9/web/modules/contrib/$PKG_NAME \
tripaldocker phpunit --coverage-text \
--coverage-clover /var/www/drupal9/web/modules/contrib/$PKG_NAME/clover.xml
docker exec tripaldocker ls /var/www/drupal9/web/modules/contrib/$PKG_NAME
- name: Publish code coverage to Code Climate
run: |
docker exec --workdir=/var/www/drupal9/web/modules/contrib/$PKG_NAME tripaldocker \
git config --global --add safe.directory /var/www/drupal9/web/modules/contrib/$PKG_NAME
docker exec --workdir=/var/www/drupal9/web/modules/contrib/$PKG_NAME \
tripaldocker ./cc-test-reporter after-build clover.xml \
--id ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} \
--debug -t clover -p /var/www/drupal9/web/modules/contrib/$PKG_NAME
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid1A.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.0'
pgsql-version: '13'
drupal-version: '9.3.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid1B.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.0'
pgsql-version: '13'
drupal-version: '9.4.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid1C.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.0'
pgsql-version: '13'
drupal-version: '9.5.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid2A.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.1'
pgsql-version: '13'
drupal-version: '9.3.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid2B.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.1'
pgsql-version: '13'
drupal-version: '9.4.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/MAIN-phpunit-Grid2C.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: PHPUnit
on:
push:
branches:
- 2.x
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run Automated testing
uses: tripal/[email protected]
with:
directory-name: 'tripal_blast'
modules: 'tripal_blast'
php-version: '8.1'
pgsql-version: '13'
drupal-version: '9.5.x-dev'
19 changes: 19 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

GitHub Actions
=================

This directory contains automated workflows executed by GitHub Actions.

Naming Conventions
--------------------

### File Name: [scope]-[purpose]-[extra_info].yml

- [scope] should be one of the following:
- MAIN for only against the master branch
- ALL for against all branches
- PR if specific to pull requests
- [purpose] should be a one word description of the purpose (e.g. phpunit, coverage)
- use snake-case if you must use more then one word (e.g. buildDocker)
- [extra_info] should be any additional information needed to make the file
name unique. For multiple words, separate words using an underscore.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
supervisord*
supervisord*
.phpunit.*
69 changes: 69 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
![Tripal Dependency](https://img.shields.io/badge/Tripal-4.0--alpha1-brightgreen)
![Development Status](https://img.shields.io/badge/Status-Active%20Development-orange)

**Developed by the University of Saskatchewan, Pulse Crop Bioinformatics team.**

## Introduction

This module provides a basic interface to allow your users to utilize your
server's NCBI BLAST+.

Specifically it provides blast program-specific forms (blastn, blastp, tblastn,
blastx are supported). In the future, there will be a single form where you
will be able to select either a nucleotide or a protein database to BLAST
against regardless of the type of query and it will decide which BLAST
program to use based on the combination of query/database type (ie: if you
selected a protein database on the nucleotide BLAST form then blastx would
be used).

BLAST submissions result in the creation of Tripal jobs which then need to run
from the command-line. This ensures that long running BLASTs will not cause
page time-outs but does add some management overhead and might result in longer
waits for users depending on how often you have cron set to run Tripal jobs.

The BLAST results page is an expandable summary table with each hit being
listed as a row in the table with query/hit/e-value information. The row can
then be expanded to include additional information including the alignment.
Download formats are allow users to download these results in the familiar
tabular, GFF3 or HTML NCBI formats.

## Automated Testing

This package is dedicated to a high standard of automated testing. We use
PHPUnit for testing and CodeClimate to ensure good test coverage and maintainability.
There are more details on [our CodeClimate project page] describing our specific
maintainability issues and test coverage.

![MaintainabilityBadge]
![TestCoverageBadge]

The following compatibility is proven via automated testing workflows.

![Tripal Version for following tests](https://img.shields.io/badge/Tripal-4.x--dev-green)

| Drupal | 9.3.x | 9.4.x | 9.5.x | 10.0.x |
|--------|-------|-------|-------|--------|
| **PHP 8.0** | ![Grid1A-Badge] | ![Grid1B-Badge] | ![Grid1C-Badge] | |
| **PHP 8.1** | ![Grid2A-Badge] | ![Grid2B-Badge] | ![Grid2C-Badge] | |

[our CodeClimate project page]: https://codeclimate.com/github/tripal/tripal_blast
[MaintainabilityBadge]: https://api.codeclimate.com/v1/badges/5071f91a02a3fcafc275/maintainability
[TestCoverageBadge]: https://api.codeclimate.com/v1/badges/5071f91a02a3fcafc275/test_coverage

[Grid1A-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid1A.yml/badge.svg
[Grid1B-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid1B.yml/badge.svg
[Grid1C-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid1C.yml/badge.svg

[Grid2A-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid2A.yml/badge.svg
[Grid2B-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid2B.yml/badge.svg
[Grid2C-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid2C.yml/badge.svg
[Grid2D-Badge]: https://github.com/tripal/tripal_blast/actions/workflows/MAIN-phpunit-Grid2D.yml/badge.svg

## Docker

```
git clone https://github.com/tripal/tripal_blast.git
cd tripal_blast
docker build --tag=tripal/tripal_blast:latest .
docker run --publish=80:80 -tid --volume=`pwd`:/var/www/drupal9/web/modules/contrib/tripal_blast tripal/tripal_blast:latest
```
61 changes: 61 additions & 0 deletions config/schema/tripal_blast.settings.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# @file
# Tripal Blast module variables/configuration.

tripal_blast.settings:
type: config_object
mapping:

# GENERAL CONFIGURATIONS:
tripal_blast_config_general:
type: mapping
mapping:
path:
type: string
label: 'Path to BLAST executables'
threads:
type: integer
label: 'Processor Threads for Blast'
eval:
type: float
label: 'E-value Threshold'
qrange:
type: integer
label: 'Max Matches in a Query Range'

# UPLOAD CONFIGURATIONS:
tripal_blast_config_upload:
type: mapping
mapping:
allow_query:
type: boolean
label: 'Allow Query Sequence Upload'
allow_target:
type: boolean
label: 'Allow Target Database Upload'

# SEQUENCE CONFIGURATIONS:
tripal_blast_config_sequence:
type: mapping
mapping:
nucleotide:
type: text
label: 'Nucleotide Example Fasta Record'
protein:
type: text
label: 'Protein Example Fasta Record'

# LARGE JOBS CONFIGURATIONS:
tripal_blast_config_jobs:
type: mapping
mapping:
max_result:
type: integer
label: 'Max Results to Display'

# NOTIFICATION CONFIGURATIONS
tripal_blast_config_notification:
type: mapping
mapping:
warning_text:
type: text
label: 'Warning Text on Blast Page'
Loading

0 comments on commit 5d73010

Please sign in to comment.