Skip to content

Commit 41658da

Browse files
Add tests (#53)
* Add tests * Configure test matrix * Update jsonschema * Fix schema * Set validation output to pretty * Fix package install * Update PR template * Force LF line endings
1 parent 15e8b41 commit 41658da

23 files changed

+6278
-86
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* text=auto
2+
3+
*.yaml text
4+
*.yml text
5+
*.json text
6+
*.txt text
7+
*.md text
8+
*.py text
9+
*.sh text
Lines changed: 88 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,88 @@
1-
<!--
2-
Thank you for your interest in contributing to the JMESPath Specification.
3-
4-
Before creating a pull request, please ensure that the feature or change has been fully discussed in a discussion and the discussion has been assigned a JEP tag.
5-
6-
This PR should include a JEP specification file based off TEMPLATE.md, named with the pattern "jep-###-title.md".
7-
Additionally, the PR should include any intended modifications to the GRAMMAR file.
8-
9-
Please complete the required sections below:
10-
-->
11-
12-
# \<TITLE>
13-
14-
|||
15-
|---|---
16-
| **JEP** |
17-
| **Author** | \<author>
18-
| **Created**| \<date>
19-
| **[SemVer](https://semver.org/spec/v2.0.0.html#summary)** | MAJOR\|MINOR\|PATCH
20-
| **[Discussion #](https://github.com/jmespath-community/jmespath.jep/discussions)** | [##](https://github.com/jmespath-community/jmespath.jep/discussions/##)
21-
22-
*Please discuss the merit of the JEP in the linked discussion. PR discussion should be limited to proofing the content of the PR and the PR proposal inital comment*
23-
24-
## Abstract
25-
26-
\<copy from JEP>
27-
28-
## Implementation Survey
29-
30-
*Omit this section if not relevant*
31-
32-
Provide a minimal demonstration of how the proposed functionality would be implemented for each programming language.
33-
Include links to any proposed dependencies. This is to ensure that each language can support the proposed functionality, allows for
34-
the review of any additional dependencies that would need to be included with each implementation, provides reference for implementers,
35-
and ensures that each proposed implementation in each language has consistent behaviour across all languages.
36-
37-
38-
### Javascript/Typescript
39-
40-
```typescript
41-
```
42-
43-
### NodeJS
44-
45-
```nodejs
46-
```
47-
48-
### Python
49-
50-
```python3
51-
```
52-
53-
### C/C++
54-
55-
```c++
56-
```
57-
58-
### C#
59-
60-
```c#
61-
```
62-
63-
### PHP
64-
65-
```php
66-
```
67-
68-
### Java
69-
70-
```java
71-
```
72-
73-
### Rust
74-
75-
```rust
76-
```
77-
78-
### Go
79-
80-
```go
81-
```
82-
83-
### Lua
84-
85-
```lua
86-
```
1+
<!--
2+
Thank you for your interest in contributing to the JMESPath Specification.
3+
4+
Before creating a pull request, please ensure that the feature or change has been fully discussed in a discussion and the discussion has been assigned a JEP tag.
5+
6+
This PR should include a JEP specification file based off TEMPLATE.md, named with the pattern "jep-###-title.md", and a compliance test json in either
7+
grammar/ or functions/ as appropriate.
8+
Additionally, the PR should include any intended modifications to the GRAMMAR file.
9+
10+
Please complete the required sections below:
11+
-->
12+
Please keep PR discussion strictly about the content of the PR and any comments on the merit of the proposal in the linked discussion.
13+
14+
# \<TITLE>
15+
16+
|||
17+
|---|---
18+
| **JEP** |
19+
| **Author** | \<author>
20+
| **Created**| \<date>
21+
| **[SemVer](https://semver.org/spec/v2.0.0.html#summary)** | MAJOR\|MINOR\|PATCH
22+
| **[Discussion #](https://github.com/jmespath-community/jmespath.jep/discussions)** | [##](https://github.com/jmespath-community/jmespath.jep/discussions/##)
23+
24+
*Please discuss the merit of the JEP in the linked discussion. PR discussion should be limited to proofing the content of the PR and the PR proposal inital comment*
25+
26+
## Abstract
27+
28+
\<copy from JEP>
29+
30+
## Implementation Survey
31+
32+
*Omit this section if not relevant*
33+
34+
Provide a minimal demonstration of how the proposed functionality would be implemented for each programming language.
35+
Include links to any proposed dependencies. This is to ensure that each language can support the proposed functionality, allows for
36+
the review of any additional dependencies that would need to be included with each implementation, provides reference for implementers,
37+
and ensures that each proposed implementation in each language has consistent behaviour across all languages.
38+
39+
40+
### Javascript/Typescript
41+
42+
```typescript
43+
```
44+
45+
### NodeJS
46+
47+
```nodejs
48+
```
49+
50+
### Python
51+
52+
```python3
53+
```
54+
55+
### C/C++
56+
57+
```c++
58+
```
59+
60+
### C#
61+
62+
```c#
63+
```
64+
65+
### PHP
66+
67+
```php
68+
```
69+
70+
### Java
71+
72+
```java
73+
```
74+
75+
### Rust
76+
77+
```rust
78+
```
79+
80+
### Go
81+
82+
```go
83+
```
84+
85+
### Lua
86+
87+
```lua
88+
```

.github/workflows/test_validate.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate tests
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
# https://code.dblock.org/2021/09/03/generating-task-matrix-by-looping-over-repo-files-with-github-actions.html
10+
list-tests:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
matrix: ${{ steps.set-matrix.outputs.matrix }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- id: set-matrix
17+
run: echo "::set-output name=matrix::$(ls grammar/*.json functions/*.json | jq -R -s -c 'split("\n")[:-1]')"
18+
validate:
19+
needs: list-tests
20+
runs-on: ubuntu-latest
21+
strategy:
22+
matrix:
23+
manifest: ${{ fromJson(needs.list-tests.outputs.matrix) }}
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions/setup-python@v3
27+
with:
28+
cache: pip
29+
cache-dependency-path: .github/workflows/validate_requirements.txt
30+
- run: pip install -r .github/workflows/validate_requirements.txt
31+
- name: Validate tests
32+
run: "jsonschema test_schema.json -o pretty -i ${{ matrix.manifest }}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jsonschema==4.4.0

0 commit comments

Comments
 (0)