-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from etclabscore/feat/testing
feat: add testing.md file
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# How to setup tests | ||
|
||
Testing is a project specific concern. That being said, each project may use a jenkins pipeline to setup CI and CD for the project. | ||
|
||
We use [jenkins-vagrant](https://github.com/etclabscore/jenkins-vagrant) | ||
|
||
Here is an example [jenkinsfile](https://jenkins.io/doc/book/pipeline/jenkinsfile/) that runs node project tests in each of osx, linux and windows: | ||
|
||
``` | ||
pipeline { | ||
agent none | ||
stages { | ||
stage('Run Tests') { | ||
parallel { | ||
stage('test') { | ||
agent { | ||
label 'macos' | ||
} | ||
steps { | ||
sh 'npm install' | ||
sh 'npm test' | ||
} | ||
} | ||
stage('linux') { | ||
agent { | ||
label 'linux' | ||
} | ||
steps { | ||
sh 'npm install' | ||
sh 'npm test' | ||
} | ||
} | ||
stage('windows') { | ||
agent { | ||
label 'windows' | ||
} | ||
steps { | ||
bat 'npm install' | ||
bat 'npm test' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` |