Skip to content

Commit 8fc80c7

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 93f24e3 + 825305b commit 8fc80c7

File tree

3 files changed

+74
-14
lines changed

3 files changed

+74
-14
lines changed

.circleci/config.yml

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
version: 2
2-
debug: true
32

43
resource_job_defaults: &resource_job_defaults
5-
docker: [{image: 'circleci/ruby:2.4.1'}]
6-
steps: [{run: 'echo $CIRCLE_JOB'}]
4+
docker: [{image: 'circleci/ruby:2.4.1'}]
5+
steps:
6+
- run:
7+
name: verify that job ran with the requested resource_class option
8+
command: |
9+
curl -k \
10+
"$CIRCLE_HOSTNAME/api/v1.1/project/github/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$CIRCLE_BUILD_NUM?\
11+
circle-token=$CIRCLE_TOKEN" | \
12+
jq '.picard.resource_class.class' | grep $CIRCLE_JOB
713
814
remote_docker_defaults: &remote_docker_defaults
915
docker: [{image: 'docker:17.06-git'}]
@@ -35,7 +41,7 @@ jobs:
3541
<<: *resource_job_defaults
3642
resource_class: medium
3743

38-
medium-plus: # 3 vCPUs, 6GB RAM
44+
medium+: # 3 vCPUs, 6GB RAM
3945
<<: *resource_job_defaults
4046
resource_class: medium+
4147

@@ -128,6 +134,35 @@ jobs:
128134
exit 0
129135
fi
130136
137+
save_and_restore_cache:
138+
docker:
139+
- image: circleci/python
140+
working_directory: ~/realitycheck
141+
steps:
142+
- checkout
143+
144+
- run: mkdir -p stuff
145+
- run: echo 5 >./stuff/thing
146+
147+
- save_cache:
148+
key: v3-file-cache-{{ .BuildNum }}
149+
paths:
150+
- ./stuff/thing
151+
152+
- run: rm -rf ./stuff/thing
153+
- run: sleep 5
154+
155+
- restore_cache:
156+
keys:
157+
- v3-file-cache-{{ .BuildNum }}
158+
159+
- run: |
160+
if [[ $(< stuff/thing) != '5' ]]; then
161+
exit 1
162+
else
163+
echo "The cache was populated"
164+
fi
165+
131166
artifacts_test_results:
132167
docker:
133168
- image: python:3.6.0
@@ -158,7 +193,7 @@ workflows:
158193
jobs:
159194
- small
160195
- medium
161-
- medium-plus
196+
- medium+
162197
- large
163198
- xlarge
164199

@@ -171,6 +206,7 @@ workflows:
171206

172207
feature_jobs:
173208
jobs:
209+
- save_and_restore_cache
174210
- contexts:
175211
context: org-global
176212
- multi-contexts:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,37 @@
1-
# realitycheck
2-
A sample app that reality-checks some basic features on your installation of CircleCI:
3-
1. Runs jobs using all known `resource_class` options (*NOTE:* your build instances must be large enough to accomodate these options—see our [Configuration Reference](https://circleci.com/docs/2.0/configuration-reference/#resource_class) for details)
4-
2. Runs [machine executor](https://circleci.com/docs/2.0/executor-types/#using-machine) & [remote Docker](https://circleci.com/docs/2.0/building-docker-images) jobs, both with and without [Docker Layer Caching](https://circleci.com/docs/2.0/docker-layer-caching)
5-
3. Tests writing to and reading from [workspaces](https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs)
6-
4. Tests the default `org-global` [context](https://circleci.com/docs/2.0/contexts) (*NOTE:* needs a key called `CONTEXT_END_TO_END_TEST_VAR` to exist in the `org-global` context), along with one additional context (likewise needs a key called `MULTI_CONTEXT_END_TO_END_VAR` to exist in an `individual-local` context)
7-
5. Tests upload/storage of [artifacts](https://circleci.com/docs/2.0/artifacts) and [test results](https://circleci.com/docs/2.0/collect-test-data)
1+
# realitycheck
82

9-
To run realitycheck, fork the repository and start building it on your installation of CircleCI.
3+
A sample app that validates some basic CircleCI features in three parallel workflows.
104

11-
If you have more ideas for things that should tested, please submit a PR against the open-source repository on GitHub where this project is maintained: <https://github.com/circleci/realitycheck>
5+
To run realitycheck, fork the repository and start building it on your installation of CircleCI. See [Using realitycheck to validate your CircleCI installation](https://support.circleci.com/hc/en-us/articles/360011235534), in the CircleCI Support Center, for details on forking the project and building it on your CircleCI installation.
6+
7+
Descriptions of the three workflows follow.
8+
9+
### `resource_class` workflow
10+
11+
Tests all known `resource_class` options—queries the CircleCI API to verify that jobs ran with the requested resources.
12+
13+
- Your instances must be large enough to accommodate these options—see our [Configuration Reference](https://circleci.com/docs/2.0/configuration-reference/#resource_class) for details
14+
- The base URL of your CircleCI installation (e.g. https://circleci.com) must be specified via a `CIRCLE_HOSTNAME` project environment variable
15+
- A personal API token (see `CIRCLE_HOSTNAME/account/api` URL endpoint) must be stored as a `CIRCLE_TOKEN` project environment variable
16+
17+
18+
### VM service workflow
19+
20+
Tests the functionality of the [`machine` executor](https://circleci.com/docs/2.0/executor-types/#using-machine), [Remote Docker Environment](https://circleci.com/docs/2.0/building-docker-images), and [Docker Layer Caching](https://circleci.com/docs/2.0/docker-layer-caching).
21+
22+
23+
### Features workflow
24+
25+
- Tests ability to save and restore [caches](circleci.com/docs/2.0/caching)
26+
- Tests writing to and reading from [workspaces](https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs)
27+
- Tests the default `org-global` [context](https://circleci.com/docs/2.0/contexts) (*NOTE:* needs a key called `CONTEXT_END_TO_END_TEST_VAR` to exist in a context called `org-global`)
28+
- Tests multiple contexts (*NOTE:* needs a key called `MULTI_CONTEXT_END_TO_END_VAR` to exist in a context called `individual-local`)
29+
- Tests upload/storage of [artifacts](https://circleci.com/docs/2.0/artifacts) and [test results](https://circleci.com/docs/2.0/collect-test-data)
30+
31+
32+
## Contributing
33+
34+
If you have more ideas for things that should tested, please submit a PR against the open-source repository on GitHub where this project is maintained: <https://github.com/circleci/realitycheck>.
1235

1336
See the current CI status of the main repo at <https://circleci.com/gh/circleci/workflows/realitycheck>.
1437

0 commit comments

Comments
 (0)