-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests have been written in Python using bblfsh python client as we don't have a bblfsh cli yet that we can download easily for these tests (see bblfsh/go-client#115) Signed-off-by: Rafael Porres Molina <[email protected]>
- Loading branch information
Rafael Porres Molina
committed
Jun 28, 2019
1 parent
7d9a9a3
commit 7260bfd
Showing
4 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
image: | ||
tag: latest-drivers | ||
pullPolicy: Always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "fullname" . }}-test | ||
labels: | ||
app: {{ template "fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | ||
release: "{{ .Release.Name }}" | ||
heritage: "{{ .Release.Service }}" | ||
data: | ||
tests.py: |- | ||
import unittest | ||
import bblfsh | ||
class TestConnection(unittest.TestCase): | ||
def test_connection(self): | ||
client = bblfsh.BblfshClient("{{ template "fullname" . }}:{{ .Values.service.externalPort }}") | ||
self.assertNotEqual(client.parse(__file__), '') | ||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ template "fullname" . }}-test" | ||
annotations: | ||
"helm.sh/hook": test-success | ||
spec: | ||
volumes: | ||
- name: tests | ||
configMap: | ||
name: {{ template "fullname" . }}-test | ||
containers: | ||
- name: {{ .Release.Name }}-test | ||
image: python:3.7-slim | ||
volumeMounts: | ||
- name: tests | ||
mountPath: /tests | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
apt-get update | ||
apt-get install -y gcc make g++ | ||
pip install bblfsh | ||
python /tests/tests.py | ||
restartPolicy: Never |