提交 491f49af 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

disable circleci, move forward to shippable

......@@ -4,9 +4,11 @@ jobs:
build:
machine: true
parallelism: 1
steps:
- checkout
# - setup_remote_docker
# - setup_remote_docker:
# docker_layer_caching: true
- run:
name: Environment Information
command: |
......
language: node_js
node_js:
- "8"
- "9"
- "8"
os:
- linux
......
此差异已折叠。
......@@ -126,18 +126,17 @@ TEST
[![Windows Build status](https://img.shields.io/appveyor/ci/chatie/wechaty/master.svg?label=Windows)](https://ci.appveyor.com/project/chatie/wechaty)
[![Docker Shippable](https://api.shippable.com/projects/5aaf8667ec373f17004dcb66/badge?branch=master)](https://app.shippable.com/github/Chatie/wechaty)
[![Coverage Status](https://coveralls.io/repos/github/Chatie/wechaty/badge.svg?branch=master)](https://coveralls.io/github/Chatie/wechaty?branch=master)
[![Known Vulnerabilities](https://snyk.io/test/github/chatie/wechaty/badge.svg)](https://snyk.io/test/github/chatie/wechaty)
Wechaty is fully tested by unit tests and integration tests, with Continious Integration & Continious Deliver(CI/CD) support, which is powered by TravisCI, CircleCI and Appveyor CI.
Wechaty is fully tested by unit tests and integration Ws, with Continious Integration & Continious Deliver(CI/CD) support, which is powered by TravisCI, CircleCI and Appveyor CI.
To test Wechaty, run:
```shell
npm test
```
Get to know more about the tests from [Wiki:Test](https://github.com/chatie/wechaty/wiki/Test)
Get to know more about the tests from [Wiki:Tests](https://github.com/chatie/wechaty/wiki/Tests)
DOCUMATAION
-------------
......
......@@ -27,13 +27,13 @@
"lint:ts": "npm run clean && echo tslint v`tslint --version` && tslint --project tsconfig.json \"{bin,examples,scripts,src,tests}/**/*.ts\" --exclude \"tests/fixtures/**\" --exclude \"dist/\" && tsc --noEmit",
"lint:sh": "bash -n bin/*.sh",
"sloc": "sloc bin examples scripts src tests index.ts --details --format cli-table --keys total,source,comment && sloc bin examples scripts src tests index.ts",
"test": "npm run clean && npm run lint && npm run test:unit:safe && npm run test:shell && npm run sloc",
"test": "npm run clean && npm run lint && npm run test:unit:retry && npm run test:shell && npm run sloc",
"test:linux": "npm run pretest && parallel ts-node -- ./src/**/*.spec.ts ./tests/**/*.spec.ts && npm run posttest",
"test:pack": "npm run dist && export TMPDIR=/tmp/wechaty.$$ && npm pack && mkdir $TMPDIR && mv wechaty-*.*.*.tgz $TMPDIR && cp tests/fixtures/smoke-testing.js $TMPDIR && cd $TMPDIR && npm init -y && npm i wechaty-*.*.*.tgz && (for i in {1..3}; do node smoke-testing.js && break || sleep 1; done)",
"test:shell": "shellcheck bin/*.sh",
"test:unit": "blue-tape -r ts-node/register -r source-map-support/register \"src/**/*.spec.ts\" \"src/*.spec.ts\" \"tests/*.spec.ts\" \"tests/**/*.spec.ts\"",
"test:unit:safe": "ts-node scripts/safe-unit-test",
"test:win32": "npm run test:unit:safe",
"test:unit:retry": "ts-node scripts/retry-unit-tests",
"test:win32": "npm run test:unit:retry",
"test:debug": "blue-tape -r ts-node/register -r source-map-support/register src/puppet-web/bridge.spec.ts",
"io-client": "ts-node bin/io-client",
"demo": "ts-node examples/ding-dong-bot.ts",
......@@ -143,9 +143,9 @@
"glob": "^7.1.0",
"jsdoc-to-markdown": "^4.0.0",
"nyc": "^11.2.0",
"qrcode-terminal": "^0.11.0",
"qrcode-terminal": "^0.12.0",
"shx": "^0.2.0",
"sinon": "^4.2.0",
"sinon": "^5.0.0",
"sinon-test": "^2.1.2",
"sloc": "^0.2.0",
"ts-node": "^5.0.0",
......
......@@ -25,11 +25,14 @@ case "$1" in
;;
test)
echo "Testing the docker image behaviors to make sure it works as expected..."
echo "bats tests/"
IMAGE_NAME="$imageName" bats tests/
echo docker run -ti $options -v /dev/shm:/dev/shm "$imageName" test
exec docker run -ti $options -v /dev/shm:/dev/shm "$imageName" test
echo
echo
echo docker run -i $options -v /dev/shm:/dev/shm "$imageName" test
exec docker run -i $options -v /dev/shm:/dev/shm "$imageName" test
ret=$?
;;
......
......@@ -8,7 +8,7 @@
*/
import { spawn } from 'child_process'
const MAX_RETRY_NUM = 5
const MAX_RETRY_NUM = 3
async function main(): Promise<number> {
console.log('Safe Test: starting...')
......
# Language setting http://docs.shippable.com/ci/languages/node/
language: python
python:
- 3.6
# use this to control what branches get built.
# http://docs.shippable.com/ci/advancedOptions/branches/
branches:
only:
- master
env:
global:
- secure: x0+gSTZx9QXVhhnEu+7iRXBEE0O/nGTXAvSJVgc+wx/qPocyB2CQqAf7+UTq3jGsrcdZYKGe8MCgxFOmT2abcv8TQn02LT9LQVsSBo9I72U4tisJcpcbFad4XkjwUXHOMZfndubGgy58GfDTNl/x1v7DB/Olhwu6nlJRYnedj22l8kdEKBpabMmrnogrWesoKKpYbkhR9Vi3XHeZ3FA5hu14wbhq8A2jpcGqh35bDpViAL7f447nPdn20SAFGOrqF3yC/Ws8keG0ChQ2IhQ4cx/ucpGmswUw+ZLJEUCQL0ZlUgkXAAUVeAUAMMywE+yWYLnfDRqnVshRdb6+lHz6VA==
build:
pre_ci_boot:
options: "-v /root/src:/root/src"
# http://docs.shippable.com/ci/shippableyml/#ci
ci:
- curl -sSL -o /tmp/bats_v0.4.0.tar.gz https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz
- tar -xf /tmp/bats_v0.4.0.tar.gz
- sudo bats-0.4.0/install.sh /usr/local
- pwd
- ls -l
- docker run -v "$(pwd)":/mnt nlknguyen/alpine-shellcheck bin/*.sh
- ./scripts/docker.sh build
- ./scripts/docker.sh test
on_success:
- if [[ "$BRANCH" == "master" && ! "$PULL_REQUEST" ]]; then curl -X POST -d '{"from":"shippable"}' "$DOCKER_REBUILD_URL"; else echo "Skipping deployment for branch $BRANCH."; fi
# Integrations are used to connect external resources to CI
# http://docs.shippable.com/integrations/overview/
integrations:
# http://docs.shippable.com/ci/shippableyml/#notifications
notifications:
# turning of email for PR builds, get notified only on failure and change in status
# http://docs.shippable.com/integrations/notifications/email/
- integrationName: email
type: email
on_success: change
on_failure: change
on_pull_request: never
#!/usr/bin/env bats
function dockerRun() {
docker run -v "$(pwd)":/bot ${IMAGE_NAME:-'wechaty:test'} $@
}
fixtures=tests/fixtures/docker
@test "javascript bot" {
@test "should succ with a simple javascript" {
cd "$fixtures"
run dockerRun js-bot.js
[ "$status" -eq 0 ]
}
@test "javascript syntax error" {
@test "should fail when javascript syntax error" {
cd "$fixtures"
run dockerRun syntax-error.js
[ "$status" -ne 0 ]
}
@test "javascript es6 import should success" {
@test "should succ with javascript es6 import syntax" {
cd "$fixtures"
run dockerRun es6-import.js
[ "$status" -eq 0 ] # should succ
}
@test "javascript es6 import with NODE_ENV=production should fail" {
@test "should fail with javascript es6 import when setting NODE_ENV=production" {
cd "$fixtures"
run dockerRun -e NODE_ENV=production es6-import.js
[ "$status" -ne 0 ] # should fail
}
@test "typescript bot" {
@test "should succ with a simple typescript" {
cd "$fixtures"
run dockerRun ts-bot.ts
[ "$status" -eq 0 ]
}
@test "typescript type error" {
@test "should fail with unmatch types in typescript" {
cd "$fixtures"
run dockerRun type-error.ts
[ "$status" -ne 0 ]
}
@test "typescript bot with import = require()" {
@test "should succ when we using 'import = require()' in typescript" {
cd "$fixtures"
run dockerRun import-require.ts
[ "$status" -eq 0 ]
}
@test "javascript bot with require" {
@test "should succ when using require with javascript" {
cd "$fixtures/with-package-json/"
run dockerRun with-require.js
[ "$status" -eq 0 ]
}
@test "javascript bot require error" {
@test "should fail when require a not exist module in javascript" {
cd "$fixtures/with-package-json/"
run dockerRun with-require-error.js
[ "$status" -ne 0 ]
}
@test "typescript bot with import" {
@test "should succ when using import in typescript" {
cd "$fixtures/with-package-json/"
run dockerRun with-import.ts
[ "$status" -eq 0 ]
}
@test "typescript bot with import error" {
@test "should fail when import a not exist module in typescript" {
cd "$fixtures/with-package-json/"
run dockerRun with-import-error.ts
[ "$status" -ne 0 ]
}
@test "doctor(default by npm run)" {
@test "should succ with arg: 'doctor' (which is the default by npm run)" {
run dockerRun doctor
[ "$status" -eq 0 ]
}
@test "run doctor" {
@test "should succ with arg: 'run doctor'" {
run dockerRun run doctor
[ "$status" -eq 0 ]
}
@test "run non-exist command" {
@test "should fail when run an unknown arg" {
run dockerRun run fdasfadsfasdfasdfasdfasd
[ "$status" -ne 0 ]
}
@test "direct non-exist command" {
@test "should fail when passing an unknown arg directly" {
run dockerRun fdasfadsfasdfasdfasdfasd
[ "$status" -ne 0 ]
}
......
box: python
build:
steps:
- script:
name: Prepare Packages
code: |
curl -sL https://deb.nodesource.com/setup_9.x | bash -
apt-get install -y nodejs
apt-get install -y libcairo2-dev libjpeg62-turbo-dev libpango1.0-dev libgif-dev build-essential g++
curl -sSL -o /tmp/bats_v0.4.0.tar.gz https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz
tar -xf /tmp/bats_v0.4.0.tar.gz
sudo bats-0.4.0/install.sh /usr/local
- script:
name: Build Wechaty Docker Image
code: |
docker run -ti -v "$(pwd)":/mnt nlknguyen/alpine-shellcheck bin/*.sh
NO_CACHE=1 ./scripts/docker.sh build
- script:
name: Test
code: ./scripts/docker.sh test
- script:
name: Environment Informations
code: |
echo "python version $(python --version) running"
echo "node version $(node -v) running"
echo "npm version $(npm -v) running"
docker --version
docker info
whoami
pwd
ls -lr
deploy:
steps:
- script:
name: Deploy Wechaty Image to Docker Hub
code: curl -X POST -d '{"from":"Wercker"}' "$DOCKER_REBUILD_URL"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册