Skip to content

Commit a289458

Browse files
committed
merge main
2 parents 9515bcf + 0819fdd commit a289458

File tree

30 files changed

+732
-51
lines changed

30 files changed

+732
-51
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ linters-settings:
2222
exhaustive:
2323
default-signifies-exhaustive: true
2424
goimports:
25-
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/lib
25+
local-prefixes: github.com/smartcontractkit/chainlink-testing-framework/
2626
gosec:
2727
exclude-generated: true
2828
errorlint:

book/src/framework/verify.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you don't want to verify contracts or you can't or don't want to use `Blocksc
2828

2929
You can use `Seth` to trace your transaction both from your Go code or from [the CLI](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#single-transaction-tracing). Remember that you need to adjust `seth.toml` to point to gethwrappers or ABIs of contracts you want to trace.
3030

31-
### Programatic
31+
### Programmatic
3232

3333
If you want to use from Go code, you need to have a couple of things in mind:
3434
* you need to point Seth to your Gethwrappers, so that it can extract ABIs from them
@@ -57,4 +57,4 @@ if err != nil {
5757
}
5858
```
5959

60-
For more information about configuring `Seth` please read about [TOML config](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#toml-configuration) and [programatic builder](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#config).
60+
For more information about configuring `Seth` please read about [TOML config](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#toml-configuration) and [programmatic builder](https://smartcontractkit.github.io/chainlink-testing-framework/libs/seth.html#config).

go.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ flowchart LR
1616
click grafana href "https://github.com/smartcontractkit/chainlink-testing-framework/grafana"
1717
havoc --> lib/grafana
1818
click havoc href "https://github.com/smartcontractkit/chainlink-testing-framework/havoc"
19+
lib --> parrot
1920
lib --> seth
2021
click lib href "https://github.com/smartcontractkit/chainlink-testing-framework/lib"
2122
lib/grafana
2223
click lib/grafana href "https://github.com/smartcontractkit/chainlink-testing-framework/lib"
24+
parrot
25+
click parrot href "https://github.com/smartcontractkit/chainlink-testing-framework/parrot"
2326
sentinel --> lib
2427
click sentinel href "https://github.com/smartcontractkit/chainlink-testing-framework/sentinel"
2528
seth

lib/.changeset/v1.52.1.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Adds Parrot Docker and K8s controllers for CTF
2+
- Begins deprecation of Killgrave and Mockserver

lib/charts/parrot/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: parrot
3+
version: 0.1.0
4+
appVersion: "0.6.1"
5+
type: application
6+
description: Parrot enables dynamic mocking of HTTP calls.
7+
keywords:
8+
- mocking
9+
- mock-server
10+
- http-mock
11+
- http
12+
- test
13+
- test-server
14+
home: https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/parrot
15+
sources:
16+
- https://github.com/smartcontractkit/chainlink-testing-framework/tree/main/parrot
17+
- https://hub.docker.com/repository/docker/kalverra/parrot/general
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "parrot.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "parrot.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "parrot.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "parrot.labels" -}}
37+
app: {{ include "parrot.fullname" . }}
38+
helm.sh/chart: {{ include "parrot.chart" . }}
39+
{{ include "parrot.selectorLabels" . }}
40+
{{- if .Chart.AppVersion }}
41+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
42+
{{- end }}
43+
app.kubernetes.io/managed-by: {{ .Release.Service }}
44+
{{- end }}
45+
46+
{{/*
47+
Selector labels
48+
*/}}
49+
{{- define "parrot.selectorLabels" -}}
50+
app.kubernetes.io/name: {{ include "parrot.fullname" . }}
51+
app.kubernetes.io/instance: {{ .Release.Name }}
52+
app: {{ include "parrot.fullname" . }}
53+
{{- end }}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: {{ include "parrot.fullname" . }}
5+
labels:
6+
{{- include "parrot.labels" . | nindent 4 }}
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
{{- include "parrot.selectorLabels" . | nindent 6 }}
12+
template:
13+
metadata:
14+
labels:
15+
{{- include "parrot.selectorLabels" . | nindent 8 }}
16+
spec:
17+
restartPolicy: Always
18+
containers:
19+
- name: {{ .Chart.Name }}
20+
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
21+
imagePullPolicy: {{ .Values.image.pullPolicy }}
22+
env:
23+
- name: PARROT_PORT
24+
value: "80"
25+
- name: PARROT_LOG_LEVEL
26+
value: "{{ .Values.logLevel }}"
27+
- name: PARROT_HOST
28+
value: "0.0.0.0"
29+
ports:
30+
- name: http
31+
containerPort: {{ .Values.service.port }}
32+
protocol: TCP
33+
{{- if .Values.persistence.enabled }}
34+
volumeMounts:
35+
- name: data
36+
mountPath: {{ .Values.persistence.mountPath }}
37+
{{- end }}
38+
resources:
39+
limits:
40+
memory: {{ .Values.resources.limits.memory }}
41+
cpu: {{ .Values.resources.limits.cpu }}
42+
livenessProbe:
43+
httpGet:
44+
path: /health
45+
port: http
46+
periodSeconds: 30
47+
{{- if .Values.persistence.enabled }}
48+
volumes:
49+
- name: data
50+
persistentVolumeClaim:
51+
claimName: {{ include "parrot.fullname" . }}
52+
{{- end }}
53+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- if .Values.persistence.enabled }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ include "parrot.fullname" . }}
6+
labels:
7+
{{- include "parrot.labels" . | nindent 4 }}
8+
spec:
9+
accessModes:
10+
- {{ .Values.persistence.accessMode | quote }}
11+
resources:
12+
requests:
13+
storage: {{ .Values.persistence.size | quote }}
14+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "parrot.fullname" . }}
5+
labels:
6+
{{- include "parrot.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- name: http
11+
protocol: TCP
12+
port: {{ .Values.service.port }}
13+
targetPort: http
14+
selector:
15+
{{- include "parrot.selectorLabels" . | nindent 4 }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "parrot.fullname" . }}-test-health"
5+
labels:
6+
{{- include "parrot.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
containers:
11+
- name: wget
12+
image: busybox
13+
command: ['wget']
14+
args: ['{{ include "parrot.fullname" . }}:{{ .Values.service.port }}/health']
15+
restartPolicy: Never

0 commit comments

Comments
 (0)