Skip to content

Commit

Permalink
chore: wip smoke test-generators (ScottLogic#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
ms14981 committed Mar 27, 2023
1 parent 9d2b9d8 commit 14894e2
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ jobs:
run: |
chmod +x ./src/index.js
# - name: Test Generator Options Command
# run: |
# echo "generator-options=$(./src/index.js generator-options openapi-forge-javascript)" >> $GITHUB_OUTPUT
# id: generator_options
- id: generator_options
name: Test Generator Options Command
run: |
Expand All @@ -71,13 +67,23 @@ jobs:
echo "expected generator-options command to produce the moduleFormat option for the JavaScript generator"
exit 1
# - name: Check Output of Generator Options
# run: |
# echo "Checking the output for moduleFormat"
# if grep -q "moduleFormat" <${{join(steps.generator_options.outputs.*, '\n')}}; then
# echo "Output includes moduleFormat"
# else
# echo "ERROR: Output does not include moduleFormat"
# echo "Full Output: ${{join(steps.generator_options.outputs.*, '\n')}}"
# exit 1
# fi
- id: test_generators
name: Test Generator Options Command
run: |
echo "test-generators<<EOF" >> $GITHUB_OUTPUT
echo "$(./src/index.js test-generators --generators openapi-forge-typescript --format "json")" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Print test-generators command STDOUT
run: echo "${{ steps.generator_options.outputs.test-generators }}"

- name: Check Output of Test Generators 1
if: ${{ fromJson(steps.generator_options.outputs.test-generators).scenarios > 0 && fromJson(steps.generator_options.outputs.test-generators).scenarios === fromJson(steps.generator_options.outputs.test-generators).passed }}
run: |
echo "test-generators command succeeded!"
- name: Check Output of Test Generators 2
if: ${{ fromJson(steps.generator_options.outputs.test-generators).scenarios > 0 && fromJson(steps.generator_options.outputs.test-generators).scenarios === fromJson(steps.generator_options.outputs.test-generators).passed }}
run: |
echo "expected test-generators command to show that all tests for the TypeScript generator are passing"
exit 1

0 comments on commit 14894e2

Please sign in to comment.