From ed3781a0979addd12bc61a3e82b6b40952c8f96a Mon Sep 17 00:00:00 2001 From: Zachary Belford Date: Wed, 20 Feb 2019 16:35:03 -0800 Subject: [PATCH 1/5] feat: add testing.md file --- TESTING.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 TESTING.md diff --git a/TESTING.md b/TESTING.md new file mode 100644 index 00000000..6eb7c323 --- /dev/null +++ b/TESTING.md @@ -0,0 +1,5 @@ +# 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) From 3b3aaf66c23da8ddd22544060868a242723aab43 Mon Sep 17 00:00:00 2001 From: Zachary Belford Date: Wed, 20 Feb 2019 16:37:36 -0800 Subject: [PATCH 2/5] fix: add simple example --- TESTING.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/TESTING.md b/TESTING.md index 6eb7c323..864f8bf3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -3,3 +3,44 @@ 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 jenkins file that runs node project tests in each of osx, linux and windows: + +```yaml +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' + } + } + } + } + } +} +``` From b410975494dc0f2ac857a310ac939f54c361293b Mon Sep 17 00:00:00 2001 From: Zachary Belford Date: Wed, 20 Feb 2019 16:38:03 -0800 Subject: [PATCH 3/5] fix: remove yaml in example --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 864f8bf3..7f25fb8d 100644 --- a/TESTING.md +++ b/TESTING.md @@ -6,7 +6,7 @@ We use [jenkins-vagrant](https://github.com/etclabscore/jenkins-vagrant) Here is an example jenkins file that runs node project tests in each of osx, linux and windows: -```yaml +``` pipeline { agent none stages { From 0e67bb12879ac45dde09f6099762e189f28319ab Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 20 Feb 2019 18:08:13 -0800 Subject: [PATCH 4/5] fix: add link to jenkins pipelines Co-Authored-By: BelfordZ --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 7f25fb8d..223f22ac 100644 --- a/TESTING.md +++ b/TESTING.md @@ -4,7 +4,7 @@ Testing is a project specific concern. That being said, each project may use a j We use [jenkins-vagrant](https://github.com/etclabscore/jenkins-vagrant) -Here is an example jenkins file that runs node project tests in each of osx, linux and windows: +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 { From 835583d812471c0b94fec9d6a99233b341827df4 Mon Sep 17 00:00:00 2001 From: Zachary Belford Date: Wed, 20 Feb 2019 18:08:51 -0800 Subject: [PATCH 5/5] fix: indenting --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index 223f22ac..da3dd6c3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -13,7 +13,7 @@ pipeline { stage('Run Tests') { parallel { stage('test') { - agent { + agent { label 'macos' } steps {