Skip to content

Commit ffda128

Browse files
authored
fix: add CI tests (#19)
- this is a fix because under the hood it updates this plugin to latest built API (work was done in PR #18)
1 parent d777e3f commit ffda128

File tree

19 files changed

+10900
-2422
lines changed

19 files changed

+10900
-2422
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules/
2-
cypress/videos
32
cypress/screenshots
3+
**/cypress/videos

CONTRIBUTING.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
How to [code a plugin](https://github.com/netlify/build/blob/master/docs/creating-a-plugin.md)
22

3-
## Testing and releasing a new version
3+
## Testing
44

5-
If helps to install [Netlify CLI](https://github.com/netlify/cli) to test the plugin locally
5+
End-to-end tests are in folder [tests](tests) and they use this [plugin locally](https://github.com/netlify/build/blob/master/README.md#using-a-local-plugin) and build each subfolder using Netlify CLI on CircleCI. You can find the test recordings at [Cypress Dashboard](https://dashboard.cypress.io/projects/ixroqc/)
66

7-
```shell
8-
npm install netlify-cli -g
9-
netlify build
10-
```
7+
## Releasing a new version
8+
9+
Before releasing check that each CircleCI job has actually run the tests correctly. We don't have a way to check if Cypress _executed all tests_, other than looking at the CircleCI terminal output.
1110

1211
Try using `beta` branch to release new pre-release versions of the plugin by following [the semantic release guide](https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/pre-releases.md). You can fork and test out new versions published to NPM using the [netlify-plugin-cypress-example](https://github.com/cypress-io/netlify-plugin-cypress-example) repository. Hope the `master` branch merged into `beta` does not bring features and fixes *already released*. Thus I suggest using `beta` branch for new features.
1312

circle.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2.1
22
orbs:
33
node: circleci/[email protected]
4+
cypress: cypress-io/cypress@1
45
jobs:
56
build:
67
executor:
@@ -23,14 +24,82 @@ jobs:
2324
- run: npm ci
2425
- run: npx semantic-release
2526

27+
'basic test':
28+
executor: cypress/base-12-14-0
29+
steps:
30+
# all dependencies were installed in previous job
31+
- attach_workspace:
32+
at: ~/
33+
- run:
34+
name: Netlify Build 🏗
35+
command: npx netlify build
36+
working_directory: tests/basic
37+
environment:
38+
DEBUG: netlify-plugin-cypress
39+
40+
'recommended test':
41+
executor: cypress/base-12-14-0
42+
steps:
43+
# all dependencies were installed in previous job
44+
- attach_workspace:
45+
at: ~/
46+
- run:
47+
name: Netlify Build 🏗
48+
command: npx netlify build
49+
working_directory: tests/recommended
50+
environment:
51+
DEBUG: netlify-plugin-cypress
52+
53+
'recording test':
54+
executor: cypress/base-12-14-0
55+
steps:
56+
# all dependencies were installed in previous job
57+
- attach_workspace:
58+
at: ~/
59+
- run:
60+
name: Netlify Build 🏗
61+
command: npx netlify build
62+
working_directory: tests/recording
63+
environment:
64+
DEBUG: netlify-plugin-cypress
65+
66+
'test-twice':
67+
executor: cypress/base-12-14-0
68+
steps:
69+
# all dependencies were installed in previous job
70+
- attach_workspace:
71+
at: ~/
72+
- run:
73+
name: Netlify Build 🏗
74+
command: npx netlify build
75+
working_directory: tests/test-twice
76+
environment:
77+
DEBUG: netlify-plugin-cypress
2678
workflows:
2779
version: 2
2880
test_and_release:
2981
jobs:
3082
- build
83+
- cypress/install
84+
- 'basic test':
85+
requires:
86+
- cypress/install
87+
- 'recommended test':
88+
requires:
89+
- cypress/install
90+
- 'recording test':
91+
requires:
92+
- cypress/install
93+
- 'test-twice':
94+
requires:
95+
- cypress/install
3196
- release:
3297
requires:
3398
- build
99+
- 'basic test'
100+
- 'recommended test'
101+
- 'recording test'
102+
- 'test-twice'
34103
filters:
35104
branches:
36105
only:

0 commit comments

Comments
 (0)