Skip to content

Commit 66cdd71

Browse files
committed
style: refines the rules test script
1 parent 5b08419 commit 66cdd71

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
run: yarn build
2828
- working-directory: ./spectral
2929
run: yarn lint
30-
# Disabled until we have single API passing tests.
3130
- working-directory: ./spectral
3231
run: yarn cli-integration-tests
3332

spectral/scripts/rules.sh

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,35 @@
44
## This apis can be used for testing
55
## Script needs to run in the test working directory
66

7+
spectralConfig="./examples/.spectral-local.yaml"
8+
baseUrl='https://raw.githubusercontent.com/redhat-developer/app-services-sdk-js/main/.openapi/'
9+
folder=".openapi"
10+
file='kas-fleet-manager.yaml'
711

8-
echo "fetching kas-fleet-manager from main"
9-
wget -P .openapi https://raw.githubusercontent.com/redhat-developer/app-services-sdk-js/main/.openapi/kas-fleet-manager.yaml
10-
echo "fetching srs from main"
11-
wget -P .openapi https://raw.githubusercontent/redhat-developer/app-services-sdk-js/main/.openapi/srs-fleet-manager.json
12-
13-
# updates made to the following need to be refected in their respective .openapi files before the linting can pass
14-
# echo "fetching connector_mgmgt from main"
15-
# wget -P .openapi https://raw.githubusercontent.com/redhat-developer/app-services-sdk-js/main/.openapi/connector_mgmt.yaml
16-
# echo "fetching smartevents from main"
17-
# wget -P .openapi https://raw.githubusercontent.com/redhat-developer/app-services-sdk-js/main/.openapi/smartevents-mgmt.yaml
18-
# echo "fetching kafka-admin from main"
19-
# wget -P .openapi https://raw.githubusercontent.com/redhat-developer/app-services-sdk-js/main/.openapi/kafka-admin-rest.yaml
20-
## TODO add more apis as they are onboarded
12+
wget -P $folder ${baseUrl}${file}
13+
echo "linting $file OAS file"
14+
yarn spectral lint $folder/$file -v -r $spectralConfig
15+
16+
file='srs-fleet-manager.json'
17+
wget -P $folder ${baseUrl}${file}
18+
echo "linting $file OAS file"
19+
yarn spectral lint $folder/$file -v -r $spectralConfig
20+
21+
## Updates made to the following need to be refected in their respective .openapi OAS files before the linting can pass and added to CI
2122

22-
## linting the fetched apis
23-
yarn spectral lint .openapi/kas-fleet-manager.yaml -v -r ./examples/.spectral-local.yaml
24-
yarn spectral lint .openapi/srs-fleet-manager.json -v -r ./examples/.spectral-local.yaml
23+
# file='connector_mgmt.yaml'
24+
# wget -P $folder ${baseUrl}${file}
25+
# echo "linting $file OAS file"
26+
# yarn spectral lint $folder/$file -v -r $spectralConfig
2527

26-
# updates made to the following need to be refected in their respective .openapi files before the linting can pass
27-
# yarn spectral lint .openapi/connector_mgmt.yaml -v -r ./examples/.spectral-local.yaml
28-
# yarn spectral lint .openapi/smartevents-mgmt.yaml -v -r ./examples/.spectral-local.yaml
29-
# yarn spectral lint .openapi/kafka-admin-rest.yaml -v -r ./examples/.spectral-local.yaml
28+
# file='smartevents.yaml'
29+
# wget -P $folder ${baseUrl}${file}
30+
# echo "linting $file OAS file"
31+
# yarn spectral lint $folder/$file -v -r $spectralConfig
32+
33+
# file='kafka-admin.yaml'
34+
# wget -P $folder ${baseUrl}${file}
35+
# echo "linting $file OAS file"
36+
# yarn spectral lint $folder/$file -v -r $spectralConfig
37+
38+
## TODO add more apis as they are onboarded

0 commit comments

Comments
 (0)