Move some travis tests to github workflow, remove redundant c# test (#13704)

* move some travis tests to github workflow, remove reduntant c# test

* setup ruby

* switch to setup-ruby

* bundle install

* remove bash

* remove bundle install

* remmvoe gemfile

* add more folders in tab detection

* comment out java folder in tab detection

* undo changes in tab detection
This commit is contained in:
William Cheng 2022-10-16 16:20:49 +08:00 committed by GitHub
parent f11cb7f17d
commit 866d67a78f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 15 deletions

32
.github/workflows/misc-test.yaml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Misc Tests
on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'
jobs:
build:
name: Misc tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
- name: Detect tabs
run: /bin/bash ./bin/utils/detect_tab_in_templates.sh
- name: Detect changes in test files
run: ./bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
- name: Detect carriage return
run: /bin/bash ./bin/utils/detect_carriage_return.sh
- name: Detect merge conflicts
run: /bin/bash ./bin/utils/detect_merge_conflict.sh
- name: Detect tabs
run: /bin/bash ./bin/utils/detect_tab_in_java_class.sh

View File

@ -147,16 +147,6 @@ script:
- set -e - set -e
# show docker buildx version # show docker buildx version
- docker buildx version - docker buildx version
# fail if the template files contains tabs
- /bin/bash ./bin/utils/detect_tab_in_templates.sh
# fail if the test files have changes
- bin/utils/detect_test_file_changes.rb bin/utils/test_file_list.yaml
# fail if templates/generators contain carriage return '\r'
- /bin/bash ./bin/utils/detect_carriage_return.sh
# fail if generators contain merge conflicts
- /bin/bash ./bin/utils/detect_merge_conflict.sh
# fail if generators contain tab '\t'
- /bin/bash ./bin/utils/detect_tab_in_java_class.sh
# run integration tests defined in maven pom.xml # run integration tests defined in maven pom.xml
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
- mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error

View File

@ -6,11 +6,11 @@
## declare an array of folders ## declare an array of folders
declare -a samples=("modules/openapi-generator/src/main/resources/kotlin-server" declare -a samples=("modules/openapi-generator/src/main/resources/kotlin-server"
"modules/openapi-generator/src/main/resources/kotlin-spring" "modules/openapi-generator/src/main/resources/kotlin-spring"
"modules/openapi-generator/src/main/resources/dart-dio"
"modules/openapi-generator/src/main/resources/dart" "modules/openapi-generator/src/main/resources/dart"
"modules/openapi-generator/src/main/resources/dart2" "modules/openapi-generator/src/main/resources/dart2"
"modules/openapi-generator/src/main/resources/aspnetcore" "modules/openapi-generator/src/main/resources/aspnetcore"
"modules/openapi-generator/src/main/resources/powershell" "modules/openapi-generator/src/main/resources/powershell"
"modules/openapi-generator/src/main/resources/r"
) )
## now loop through the above array ## now loop through the above array

View File

@ -1,7 +1,7 @@
--- ---
# csharp-netcore test files and image for upload # csharp-netcore test files and image for upload
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs" - filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/JSONComposedSchemaTests.cs"
sha256: 64024927bc08a520ff11ba7083f83be960909a19ef273f63c1eaaef1cc6f34a2 sha256: aaa596db60531417994533b0e7962eca21dcaf8fa3aea1e2e3cb8b1b216cb89f
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs" - filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/Api/PetApiTests.cs"
sha256: dae985015ba461297927d544a78267f2def35e07c3f14ca66468fd61e1fd1c26 sha256: dae985015ba461297927d544a78267f2def35e07c3f14ca66468fd61e1fd1c26
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png" - filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"

View File

@ -51,9 +51,8 @@ namespace Org.OpenAPITools.Test.Model
[Fact] [Fact]
public void CatInstanceTest() public void CatInstanceTest()
{ {
// test to ensure both Cat and Animal (parent) can have "AdditionalProperties", which result in warnings // TODO uncomment below to test "IsType" Cat
Cat c = JsonConvert.DeserializeObject<Cat>("{\"className\":\"cat\",\"bar\":\"from json bar\"}"); //Assert.IsType<Cat>(instance);
Assert.Equal("from json bar", c.AdditionalProperties["bar"]);
} }