Skip to content

Commit

Permalink
fix circleci test
Browse files Browse the repository at this point in the history
  • Loading branch information
Miachol committed Nov 15, 2018
1 parent 78c5325 commit e449dd7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
# specify the version you desire here
- image: bioinstaller/ngsjs:latest

working_directory: ~/repo
working_directory: /tmp/ngsjs

steps:
- checkout
Expand All @@ -21,12 +21,10 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: source /etc/profile && yarn install

- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}

# run tests!
- run: source /etc/profile && yarn test
- run: source /etc/profile && yarn global add /tmp/ngsjs && yarn test
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ knitr::opts_chunk$set(
</p>

<p align="center">
<a href="https://circleci.com/gh/ngsjs/ngsjs/tree/master"><img src="https://img.shields.io/circleci/project/github/ngsjs/ngsjs/master.svg" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/badge/lifecycle-experimental-orange.svg" alt="Life cycle: experimental">
<a href="https://circleci.com/gh/ngsjs/ngsjs/tree/master"><img src="https://img.shields.io/circleci/project/github/ngsjs/ngsjs/master.svg" alt="Build Status"></a>
<a href="https://npmcharts.com/compare/ngsjs?minimal=true"><img src="https://img.shields.io/npm/dm/ngsjs.svg" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/npm/v/ngsjs.svg" alt="Version"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/npm/l/ngsjs.svg" alt="License"></a>
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
</p>

<p align="center">
<a href="https://circleci.com/gh/ngsjs/ngsjs/tree/master"><img src="https://img.shields.io/circleci/project/github/ngsjs/ngsjs/master.svg" alt="Build Status"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/badge/lifecycle-experimental-orange.svg" alt="Life cycle: experimental">
<a href="https://circleci.com/gh/ngsjs/ngsjs/tree/master"><img src="https://img.shields.io/circleci/project/github/ngsjs/ngsjs/master.svg" alt="Build Status"></a>
<a href="https://npmcharts.com/compare/ngsjs?minimal=true"><img src="https://img.shields.io/npm/dm/ngsjs.svg" alt="Downloads"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/npm/v/ngsjs.svg" alt="Version"></a>
<a href="https://www.npmjs.com/package/ngsjs"><img src="https://img.shields.io/npm/l/ngsjs.svg" alt="License"></a>
Expand Down
8 changes: 4 additions & 4 deletions bin/ngsjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ suppressMessages(if(!require('pacman')) install.packages('pacman'))
pkgs <- c("optparse")
suppressMessages(pacman::p_load(pkgs, character.only = TRUE))
option_list <- list(
make_option(c("--list-all-subcmds"), action = "store_true", default = FALSE, help = "Print all supported subcmds of ngsjs.")
make_option(c("-l", "--list-all-subcmds"), action = "store_true", default = FALSE, help = "Print all supported subcmds of ngsjs.")
)

subcmds <- "rbashful, rconfig, rdeps, rinstall, rsession, rclrs, rmv, rtime_stamp, ranystr, rdownload"
subcmds <- "rbashful rconfig rdeps rinstall rsession rclrs rmv rtime_stamp ranystr rdownload"
description <- sprintf("Description:\n%s %s\n%s",
"Main interface of ngsjs package tools.",
sprintf("Now, total %s subcmds are supported: %s.",
length(strsplit(subcmds, ", ")[[1]]), subcmds),
length(strsplit(subcmds, " ")[[1]]), subcmds),
"View the ngsjs homepage https://github.com/ngsjs/ngsjs for more detail."
)
usage <- paste(sprintf("%%prog [subcmds: %s]", subcmds),
Expand All @@ -29,7 +29,7 @@ opt <- opt$option
if (length(opt_args) == 0 && !opt[['list-all-subcmds']]) {
print_help(opt_parser_obj)
} else if (length(opt_args) == 0 && opt[['list-all-subcmds']]) {
cat(sprintf("Availabe: %s", subcmds), sep = "\n")
cat(sprintf("%s", subcmds), sep = "\n")
} else {
if (opt$help) system(sprintf("%s -h", paste(opt_args, collapse = " ")))
else system(paste(opt_args, collapse = " "))
Expand Down
5 changes: 5 additions & 0 deletions doc/changelogs/CHANGELOG_V0.1.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
- './bin/rtime_stamp' support to generate time stamp
- `./bin/ranstr` support to generate random strings
- `./bin/rdownload` support to parallel download urls
- `ngsjs --list-all-subcmds` return all sub-commands split by space
**Test related:
- add `./scripts/test/start_cli_test` to test the command line tools default output
**Minor bug fix:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
],
"scripts": {
"gadd": "yarn global add `pwd`",
"test": "./bin/rdeps && ./bin/ngsjs && ./bin/rbashful && ./bin/rconfig && ./bin/rinstall && ./bin/rsession && ./bin/rclrs && ./bin/rmv && "
"test": "./scripts/test/start_cli_test"
},
"bin": {
"ngsjs": "./bin/ngsjs",
Expand Down
6 changes: 6 additions & 0 deletions scripts/test/start_cli_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env Rscript
subcmds <- system("ngsjs --list-all-subcmds", intern = TRUE)
subcmds <- strsplit(subcmds, " ")[[1]]
status <- sapply(subcmds, system)
if (!all(status == 0))
stop("Test error.")
2 changes: 2 additions & 0 deletions src/ngsjs/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Encoding: UTF-8
LazyData: true
Imports:
configr (>= 0.3.4.1),
BioInstaller (>= 0.3.6.3001),
ngstk (>= 0.2.2.2)
Remotes:
Miachol/configr,
JhuangLab/BioInstaller,
Expand Down

0 comments on commit e449dd7

Please sign in to comment.