mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-24 20:27:02 +00:00
Merge pull request #74 from yannh/add-regression-tests-openapi2jsonschema
Add regression tests openapi2jsonschema
This commit is contained in:
commit
72d648a5d1
7 changed files with 11981 additions and 2 deletions
16
.github/workflows/main.yml
vendored
16
.github/workflows/main.yml
vendored
|
|
@ -1,7 +1,7 @@
|
||||||
name: ci
|
name: ci
|
||||||
on: push
|
on: push
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
kubeconform-test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
|
|
@ -16,9 +16,21 @@ jobs:
|
||||||
- name: acceptance-test
|
- name: acceptance-test
|
||||||
run: make docker-acceptance
|
run: make docker-acceptance
|
||||||
|
|
||||||
|
openapi2jsonschema-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: acceptance-test
|
||||||
|
working-directory: ./scripts
|
||||||
|
run: make docker-acceptance
|
||||||
|
|
||||||
goreleaser:
|
goreleaser:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: test
|
needs:
|
||||||
|
- kubeconform-test
|
||||||
|
- openapi2jsonschema-test
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
- name: checkout
|
||||||
|
|
|
||||||
6
scripts/Dockerfile.bats
Normal file
6
scripts/Dockerfile.bats
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
FROM python:3.9.7-alpine3.14
|
||||||
|
RUN apk --no-cache add bats
|
||||||
|
COPY acceptance.bats openapi2jsonschema.py requirements.txt /code/
|
||||||
|
COPY fixtures /code/fixtures
|
||||||
|
WORKDIR /code
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
9
scripts/Makefile
Normal file
9
scripts/Makefile
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/make -f
|
||||||
|
|
||||||
|
# This is really early days
|
||||||
|
|
||||||
|
build-python-bats:
|
||||||
|
docker build -t python-bats -f Dockerfile.bats .
|
||||||
|
|
||||||
|
docker-acceptance: build-python-bats
|
||||||
|
docker run --entrypoint "/usr/bin/bats" -t python-bats /code/acceptance.bats
|
||||||
9
scripts/acceptance.bats
Normal file
9
scripts/acceptance.bats
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
|
@test "Should generate expected prometheus resource" {
|
||||||
|
run ./openapi2jsonschema.py fixtures/prometheus-operator-0prometheusCustomResourceDefinition.yaml
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ "$output" = "JSON schema written to prometheus_v1.json" ]
|
||||||
|
run diff prometheus_v1.json ./fixtures/prometheus_v1-expected.json
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load diff
7097
scripts/fixtures/prometheus_v1-expected.json
Normal file
7097
scripts/fixtures/prometheus_v1-expected.json
Normal file
File diff suppressed because it is too large
Load diff
1
scripts/requirements.txt
Normal file
1
scripts/requirements.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
pyyaml
|
||||||
Loading…
Reference in a new issue