Skip to content

feature/smoke tests #2337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 77 commits into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
fb12a18
- makes kiota builder trimmable
baywet Feb 24, 2023
ace6e4e
- moves integration tests outside of main workflow
baywet Feb 24, 2023
abc686c
- formatting fixes
baywet Feb 24, 2023
4398c83
- adds chmod for kiota
baywet Feb 24, 2023
9b4ae43
- fixes path to kiota command
baywet Feb 24, 2023
c9d66d6
- uses type info for configuration serialization
baywet Feb 27, 2023
ccbb549
- replaces configuration binding by trimmable equivalent
baywet Feb 27, 2023
d6a5e78
- fixes formatting
baywet Feb 28, 2023
9a8849f
- adds a configuration file to exclude problematic api paths
baywet Feb 28, 2023
0a4c748
- adds a script to get the additional commands
baywet Mar 1, 2023
515f00e
- fixes the set additional command step
baywet Mar 1, 2023
18b6d22
- switches to output variable instead
baywet Mar 1, 2023
f10c4a2
- another attempt at fixing generate integration tests
baywet Mar 1, 2023
1e12ca4
- adds missing quotes
baywet Mar 1, 2023
ee4b83a
- adds a CSharp integration test
baywet Mar 1, 2023
9534b95
- groups all languages and descriptions in a single matrix
baywet Mar 1, 2023
19b975d
- adds missing language argument
baywet Mar 1, 2023
8a6af2c
- fixes artifact name build
baywet Mar 1, 2023
61bab48
- fixes path management
baywet Mar 1, 2023
0e954c4
- fixes command generation
baywet Mar 1, 2023
55113e9
- always runs replace url step
baywet Mar 1, 2023
7a864e6
- fixes naming regex
baywet Mar 1, 2023
16dcbec
- adds go support
baywet Mar 1, 2023
acedfbd
- adds missing fo steps
baywet Mar 1, 2023
11358f9
- fixes go integration test
baywet Mar 2, 2023
532a43e
- fixes go integration tests NS
baywet Mar 2, 2023
caea9a5
- another attempt at fixing go integration tests
baywet Mar 2, 2023
bd694e4
- adds missing import for format
baywet Mar 2, 2023
786082a
- adds typescript integration testing
baywet Mar 2, 2023
e53eb78
- fixes setup node step
baywet Mar 2, 2023
2ef5f3c
- removes node modules for typescript
baywet Mar 2, 2023
309a423
- adds missing shell type
baywet Mar 2, 2023
60e7d2d
- 🤦‍♂️
baywet Mar 2, 2023
783bb63
- fixes configuration for github api
baywet Mar 2, 2023
13ef991
- adds ruby integration tests
baywet Mar 2, 2023
a3ce57a
- removes gemfile lock
baywet Mar 2, 2023
9ad1dfe
- multiple fixes to ruby integration tests
baywet Mar 2, 2023
4740c40
- additional set of fixes for ruby integration tests
baywet Mar 2, 2023
17f9c8b
- ruby api client path fix
baywet Mar 2, 2023
b5963ec
- typo 🤦‍♂️
baywet Mar 2, 2023
2cc8afc
- removes ruby lock
baywet Mar 2, 2023
9c1e2ea
- disables rubocops we don't care about
baywet Mar 2, 2023
89fd1bd
- disables another set of rubocops
baywet Mar 2, 2023
8b15008
- last batch of rubocops disablement
baywet Mar 2, 2023
9670546
- adds suppression capability for integration tests
baywet Mar 3, 2023
efcdc4f
- adds a temporary test step
baywet Mar 3, 2023
717c359
- attempt to fix a casing issue for the condition
baywet Mar 3, 2023
bcbd91f
- uses the environment variable
baywet Mar 3, 2023
2a43aa9
- adds missing suppressions
baywet Mar 3, 2023
f1b105b
- adds php to the integration tests
baywet Mar 3, 2023
afa1131
- fixes php integration project
baywet Mar 3, 2023
c4d95c1
- because php is picky on quotes
baywet Mar 3, 2023
dd52cd6
- fixes suppression rule
baywet Mar 3, 2023
6496009
- additional suppressions for PHP integration tests
baywet Mar 3, 2023
05c3f1e
- adds python project
baywet Mar 6, 2023
0f87697
- fixes import for API client
baywet Mar 6, 2023
71d3408
- fixes missing dependencies for python
baywet Mar 6, 2023
8464d65
- disables line too long for python
baywet Mar 6, 2023
9ceecce
- suppressed import rules in python
baywet Mar 6, 2023
b04ebe4
- moves mypy configuration to correct file
baywet Mar 6, 2023
844c642
- suppresses all missing imports
baywet Mar 6, 2023
2c72a3e
- adds additional suppressions
baywet Mar 6, 2023
4e3bdde
- adds additional API descriptions to integration tests
baywet Mar 6, 2023
e4a5967
- adds a cleanup step for the generator bits
baywet Mar 6, 2023
dfa0a25
- fixes overflow exception
baywet Mar 7, 2023
e7a20ba
- fixes a bug where union type conversion could conflict with parent …
baywet Mar 7, 2023
91803f7
- adds additional suppressions
baywet Mar 7, 2023
0ce432d
- additional exclusions
baywet Mar 7, 2023
41feb74
- fixes encoding
baywet Mar 7, 2023
32480fe
- removes suppression thanks to fix
baywet Mar 7, 2023
350858a
- additional suppressions
baywet Mar 7, 2023
4639418
- additional suppressions
baywet Mar 8, 2023
c8b370a
- additional suppressions
baywet Mar 8, 2023
5887698
- moves php suppression to the right place
baywet Mar 8, 2023
ddf418e
- adds suppressions for python
baywet Mar 9, 2023
07734d0
Update src/Kiota.Builder/SearchProviders/GitHub/GitHubSearchProvider.cs
baywet Mar 9, 2023
cb9ed34
- fixes async usage for JSON lib
baywet Mar 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,28 +114,3 @@ jobs:
./${{ matrix.os }}/kiota info -l Java
exit 1
fi

java-it:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Build
run: dotnet build kiota.sln --no-restore
- name: Generate Java Code
run: ./it/java/generate.sh
- uses: actions/cache@v3
with:
path: /root/.jbang
key: $-jbang-$
restore-keys: |
$-jbang-
- name: jbang
uses: jbangdev/[email protected]
with:
script: ./it/java/test.java
env:
JBANG_REPO: /root/.jbang/repository
243 changes: 243 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,243 @@
name: integration-tests

on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
[
"abstractions/**",
"authentication/**",
"serialization/**",
"http/**",
"**.md",
".vscode/**",
"**.svg",
]
pull_request:
paths-ignore:
[
"abstractions/**",
"authentication/**",
"serialization/**",
"http/**",
"**.md",
".vscode/**",
"**.svg",
]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore workloads
run: dotnet workload restore
- name: Restore dependencies
run: dotnet restore kiota.sln
- name: Build
run: dotnet publish ./src/kiota/kiota.csproj -c Release -p:PublishSingleFile=true -p:PublishReadyToRun=true -o ./publish
# -p:PublishTrimmed=true -p:PublishAot=true should be enabled to make test run faster, but there are still limitations
- uses: actions/upload-artifact@v3
with:
name: generator
path: publish
- uses: actions/upload-artifact@v3
with:
name: it
path: it
- uses: actions/upload-artifact@v3
with:
name: tests
path: tests/**/*.yaml
integration:
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
language: [ java, csharp, go, typescript, ruby, php, python ]
description:
- './tests/Kiota.Builder.IntegrationTests/InheritingErrors.yaml'
- './tests/Kiota.Builder.IntegrationTests/NoUnderscoresInModel.yaml'
- 'https://raw.githubusercontent.com/github/rest-api-description/main/descriptions/api.github.com/api.github.com.yaml'
- 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/twitter.com/current/2.61/openapi.yaml'
- 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/notion.com/1.0.0/openapi.yaml'
- 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/stripe.com/2022-11-15/openapi.yaml'
- 'https://raw.githubusercontent.com/googlemaps/openapi-specification/main/dist/google-maps-platform-openapi3.yml'
- 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/meraki.com/v1.31.0/openapi.yaml'
- 'https://developers.pipedrive.com/docs/api/v1/openapi.yaml'
- 'https://raw.githubusercontent.com/APIs-guru/openapi-directory/main/APIs/twilio.com/api/1.39.1/openapi.yaml'
- 'https://api.apis.guru/v2/specs/docusign.net/v2.1/openapi.yaml'
steps:
- uses: actions/download-artifact@v3
with:
name: generator
path: publish
- uses: actions/download-artifact@v3
with:
name: it
path: it
- uses: actions/download-artifact@v3
with:
name: tests
path: tests
- run: |
chmod +x ./publish/kiota
chmod +x ./it/get-additional-arguments.ps1
chmod +x ./it/get-is-suppressed.ps1
- name: Check if test is suppressed
id: check-suppressed
run: |
$isSuppressed = . ./it/get-is-suppressed.ps1 -descriptionUrl ${{ matrix.description }} -language ${{ matrix.language }}
Write-Output "IS_SUPPRESSED=$($isSuppressed.ToString().ToLowerInvariant())" >> $Env:GITHUB_OUTPUT
shell: pwsh
- name: Generate Code
run: |
$additionalCommand = . ./it/get-additional-arguments.ps1 -descriptionUrl ${{ matrix.description }} -language ${{ matrix.language }}
$finalCommand = "./publish/kiota generate --language ${{ matrix.language }} --openapi ${{ matrix.description }}$additionalCommand"
Write-Host "Final command: $finalCommand"
iex $finalCommand
shell: pwsh
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
- uses: actions/cache@v3
if: matrix.language == 'java'
with:
path: /root/.jbang
key: $-jbang-$
restore-keys: |
$-jbang-
- name: jbang
if: matrix.language == 'java'
uses: jbangdev/[email protected]
with:
script: ./it/java/test.java
env:
JBANG_REPO: /root/.jbang/repository
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
- name: Setup .NET
if: matrix.language == 'csharp'
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- run: dotnet build
if: matrix.language == 'csharp'
working-directory: ./it/csharp
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
- run: |
Remove-Item obj -Recurse -ErrorAction SilentlyContinue
if: always() && matrix.language == 'csharp'
working-directory: ./it/csharp
shell: pwsh
- name: Setup Go
if: matrix.language == 'go'
uses: actions/setup-go@v3
with:
go-version: '^1.20'
- run: go install
if: matrix.language == 'go'
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
working-directory: ./it/go
- run: go build
if: matrix.language == 'go'
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
working-directory: ./it/go
- uses: actions/setup-node@v3
if: matrix.language == 'typescript'
with:
node-version: '18'
- run: npm install
if: matrix.language == 'typescript'
working-directory: ./it/typescript
- run: npm run build
if: matrix.language == 'typescript'
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
working-directory: ./it/typescript
- run: |
Remove-Item node_modules -Recurse -ErrorAction SilentlyContinue
Remove-Item dist -Recurse -ErrorAction SilentlyContinue
if: always() && matrix.language == 'typescript'
working-directory: ./it/typescript
shell: pwsh
- name: Set up Ruby
if: matrix.language == 'ruby'
uses: ruby/setup-ruby@v1
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
with:
working-directory: ./it/ruby
ruby-version: '3.2.0'
bundler-cache: true
- run: git init #required for bundler to work
if: matrix.language == 'ruby'
working-directory: ./it/ruby
- run: bundle exec rake
if: matrix.language == 'ruby'
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
working-directory: ./it/ruby
- run: |
Remove-Item vendor -Recurse -ErrorAction SilentlyContinue
Remove-Item .git -Recurse -ErrorAction SilentlyContinue
Remove-Item Gemfile.lock -ErrorAction SilentlyContinue
if: always() && matrix.language == 'ruby'
working-directory: ./it/ruby
shell: pwsh
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
coverage: xdebug
if: matrix.language == 'php'
- run: composer install
if: matrix.language == 'php'
working-directory: ./it/php
- run: ./vendor/bin/phpstan
if: matrix.language == 'php'
working-directory: ./it/php
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
- run: |
Remove-Item vendor -Recurse -ErrorAction SilentlyContinue
Remove-Item composer.lock -ErrorAction SilentlyContinue
if: always() && matrix.language == 'php'
working-directory: ./it/php
shell: pwsh
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '3.11'
if: matrix.language == 'python'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev --skip-lock
if: matrix.language == 'python'
working-directory: ./it/python
- run: |
pipenv run pylint integration_test --disable=W --rcfile=.pylintrc
pipenv run mypy integration_test
if: matrix.language == 'python'
working-directory: ./it/python
continue-on-error: ${{ steps.check-suppressed.outputs.IS_SUPPRESSED == 'true' }}
- id: replace_url
if: always()
run: |
ORIGINAL="${{ matrix.description }}"
REPLACED="${ORIGINAL//[-:<>|\*\?\\\/\.]/_}"
echo "ARTKEY=$REPLACED" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: always()
with:
name: generation-results-${{ matrix.language }}-${{ steps.replace_url.outputs.ARTKEY }}
path: it/${{ matrix.language }}

cleanup:
runs-on: ubuntu-latest
needs: [integration]
steps:
- uses: jimschubert/delete-artifacts-action@v1
with:
artifact_name: 'generator'
min_bytes: '0'
Loading