Skip to content

Commit 6d62a78

Browse files
test: add cache persistence and invalidation tests (#22013)
* test: add cache persistance and invalidation tests Co-authored-by: Sidhartha Chatterjee <[email protected]> * remove unused file * Add some comments and clean up Co-authored-by: Sidhartha Chatterjee <[email protected]>
1 parent 21f3dfb commit 6d62a78

File tree

103 files changed

+4315
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+4315
-2
lines changed

.circleci/config.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,10 @@ commands:
194194
type: string
195195
test_command:
196196
type: string
197-
default: "" # if unset, e2e-test.sh specifies the command
197+
default: "yarn test"
198+
run_loki:
199+
type: boolean
200+
default: false
198201
steps:
199202
- <<: *attach_to_bootstrap
200203
# In case of failure, add these steps again. Cache probably got deleted
@@ -205,7 +208,17 @@ commands:
205208
condition: << parameters.skip_file_change_test >>
206209
steps:
207210
- run: ./scripts/assert-changed-files.sh "<< parameters.trigger_pattern >>|<< parameters.test_path >>/*"
208-
- run: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"
211+
- run:
212+
name: Run tests (using defaults)
213+
command: ./scripts/e2e-test.sh "<< parameters.test_path >>" "<< parameters.test_command >>"
214+
215+
- when:
216+
condition: << parameters.run_loki >>
217+
steps:
218+
- run:
219+
command: GATSBY_DB_NODES=loki << parameters.test_command >>
220+
name: Run tests (using Loki)
221+
working_directory: << parameters.test_path >>
209222

210223
version: 2.1
211224

@@ -269,6 +282,13 @@ jobs:
269282
- e2e-test:
270283
test_path: integration-tests/long-term-caching
271284

285+
integration_tests_cache_resilience:
286+
executor: node
287+
steps:
288+
- e2e-test:
289+
test_path: integration-tests/cache-resilience
290+
run_loki: true
291+
272292
integration_tests_gatsby_pipeline:
273293
executor: node
274294
steps:
@@ -647,6 +667,8 @@ workflows:
647667
- bootstrap
648668
- integration_tests_long_term_caching:
649669
<<: *e2e-test-workflow
670+
- integration_tests_cache_resilience:
671+
<<: *e2e-test-workflow
650672
- integration_tests_gatsby_pipeline:
651673
<<: *e2e-test-workflow
652674
- integration_tests_structured_logging:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
plugins/**/gatsby-node.js
2+
gatsby-config.js
3+
src/pages/scenarios
4+
5+
# temporary test artifacts
6+
on_pre_bootstrap.state
7+
on_post_build.state
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 gatsbyjs
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)