Skip to content

Commit

Permalink
Move some travis tests to github workflow, remove redundant c# test (O…
Browse files Browse the repository at this point in the history
…penAPITools#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
  • Loading branch information
wing328 authored Oct 16, 2022
1 parent f11cb7f commit 866d67a
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 15 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/misc-test.yaml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 0 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,6 @@ script:
- set -e
# show 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
# 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
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/detect_tab_in_templates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
## declare an array of folders
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/dart-dio"
"modules/openapi-generator/src/main/resources/dart"
"modules/openapi-generator/src/main/resources/dart2"
"modules/openapi-generator/src/main/resources/aspnetcore"
"modules/openapi-generator/src/main/resources/powershell"
"modules/openapi-generator/src/main/resources/r"
)

## now loop through the above array
Expand Down
2 changes: 1 addition & 1 deletion bin/utils/test_file_list.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# csharp-netcore test files and image for upload
- 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"
sha256: dae985015ba461297927d544a78267f2def35e07c3f14ca66468fd61e1fd1c26
- filename: "samples/client/petstore/csharp-netcore/OpenAPIClient/src/Org.OpenAPITools.Test/linux-logo.png"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ public void Dispose()
[Fact]
public void CatInstanceTest()
{
// test to ensure both Cat and Animal (parent) can have "AdditionalProperties", which result in warnings
Cat c = JsonConvert.DeserializeObject<Cat>("{\"className\":\"cat\",\"bar\":\"from json bar\"}");
Assert.Equal("from json bar", c.AdditionalProperties["bar"]);
// TODO uncomment below to test "IsType" Cat
//Assert.IsType<Cat>(instance);
}


Expand Down

0 comments on commit 866d67a

Please sign in to comment.