From 4965dece7bd003418181c7015933772e41d92572 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 15:25:51 -0300 Subject: [PATCH 1/5] Add Pharo 11 Update GitHub actions versions --- .github/workflows/loading-groups.yml | 4 ++-- .github/workflows/markdown-lint.yml | 2 +- .github/workflows/unit-tests.yml | 8 ++++---- README.md | 1 + 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/loading-groups.yml b/.github/workflows/loading-groups.yml index 8567035..9d7bf8c 100644 --- a/.github/workflows/loading-groups.yml +++ b/.github/workflows/loading-groups.yml @@ -8,11 +8,11 @@ jobs: strategy: fail-fast: false matrix: - smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] load-spec: [ deployment, dependent-sunit-extensions, tests, development, tools, examples, core, healthcheck, metrics, metrics-http, json-rpc, app-control, app-info, app-config, loggers ] name: ${{ matrix.smalltalk }} + ${{ matrix.load-spec }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: ${{ matrix.smalltalk }} diff --git a/.github/workflows/markdown-lint.yml b/.github/workflows/markdown-lint.yml index c1f5f49..d7ebc56 100644 --- a/.github/workflows/markdown-lint.yml +++ b/.github/workflows/markdown-lint.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: markdownlint - uses: reviewdog/action-markdownlint@v0.1 + uses: reviewdog/action-markdownlint@v0 with: github_token: ${{ secrets.GITHUB_TOKEN }} fail_on_error: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f625caf..a097430 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,10 +8,10 @@ jobs: strategy: fail-fast: false matrix: - smalltalk: [ Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] + smalltalk: [ Pharo64-11, Pharo64-10, Pharo64-9.0, Pharo64-8.0 ] name: ${{ matrix.smalltalk }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: hpi-swa/setup-smalltalkCI@v1 with: smalltalk-image: ${{ matrix.smalltalk }} @@ -21,7 +21,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 15 - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: - name: ${{matrix.os}}-${{matrix.smalltalk}} + name: Unit-Tests-${{matrix.smalltalk}} token: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index b8968d1..e8721ab 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Stargate is a library supporting the creation of HTTP based RESTful APIs. [![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://pharo.org) [![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org) [![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org) +[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org) Quick links From 0ea219d105534ea124e55da6379ca9247f136cc2 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 15:39:06 -0300 Subject: [PATCH 2/5] Update Teapot version --- source/BaselineOfStargate/BaselineOfStargate.class.st | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/BaselineOfStargate/BaselineOfStargate.class.st b/source/BaselineOfStargate/BaselineOfStargate.class.st index f68f1dc..ee16e17 100644 --- a/source/BaselineOfStargate/BaselineOfStargate.class.st +++ b/source/BaselineOfStargate/BaselineOfStargate.class.st @@ -44,7 +44,7 @@ BaselineOfStargate >> setUpDependencies: spec [ with: [ spec loads: 'Dependent-SUnit-Extensions' ]. spec - baseline: 'Teapot' with: [ spec repository: 'github://zeroflag/Teapot:v2.6.0/source' ]; + baseline: 'Teapot' with: [ spec repository: 'github://zeroflag/Teapot:v2.7.0/source' ]; project: 'Teapot-Deployment' copyFrom: 'Teapot' with: [ spec loads: 'Deployment' ]. spec From 6419bde195956f4821455ac8499bea8a8b62124e Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 15:45:31 -0300 Subject: [PATCH 3/5] Exclude from coverage tests dumping the stack --- .smalltalkci/.loading.development.ston | 8 +------- .smalltalkci/.loading.tests.ston | 8 +------- .smalltalkci/.unit-tests.ston | 13 ++++++++++++- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.smalltalkci/.loading.development.ston b/.smalltalkci/.loading.development.ston index ff94696..52fe495 100644 --- a/.smalltalkci/.loading.development.ston +++ b/.smalltalkci/.loading.development.ston @@ -6,11 +6,5 @@ SmalltalkCISpec { #load : [ 'Development' ], #platforms : [ #pharo ] } - ], - #testing : { - #coverage : { - #packages : [ 'Stargate*' ], - #format: #lcov - } - } + ] } diff --git a/.smalltalkci/.loading.tests.ston b/.smalltalkci/.loading.tests.ston index 1b0c84a..5b4b11c 100644 --- a/.smalltalkci/.loading.tests.ston +++ b/.smalltalkci/.loading.tests.ston @@ -6,11 +6,5 @@ SmalltalkCISpec { #load : [ 'Tests' ], #platforms : [ #pharo ] } - ], - #testing : { - #coverage : { - #packages : [ 'Stargate*' ], - #format: #lcov - } - } + ] } diff --git a/.smalltalkci/.unit-tests.ston b/.smalltalkci/.unit-tests.ston index a8b2846..bad0d06 100644 --- a/.smalltalkci/.unit-tests.ston +++ b/.smalltalkci/.unit-tests.ston @@ -8,8 +8,19 @@ SmalltalkCISpec { } ], #testing : { + #exclude : { + #packages : [ 'Stargate-API-Skeleton*'] + }, #coverage : { - #packages : [ 'Stargate*' ], + #packages : [ + 'Stargate-Application*', + 'Stargate-Examples*', + 'Stargate-HealthCheck*', + 'Stargate-JSON*', + 'Stargate-Loggers*', + 'Stargate-Metrics*', + 'Stargate-Model*', + 'Stargate-SUnit-Model*' ], #format: #lcov } } From 16683dffcce22316f60018cd9c69d2669067d435 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 16:04:52 -0300 Subject: [PATCH 4/5] Move stack tracing test to another case --- ...teApplicationStackTraceDumperTest.class.st | 33 +++++++++++++++++++ .../StargateApplicationTest.class.st | 17 ---------- 2 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 source/Stargate-API-Skeleton-Tests/StargateApplicationStackTraceDumperTest.class.st diff --git a/source/Stargate-API-Skeleton-Tests/StargateApplicationStackTraceDumperTest.class.st b/source/Stargate-API-Skeleton-Tests/StargateApplicationStackTraceDumperTest.class.st new file mode 100644 index 0000000..519b83b --- /dev/null +++ b/source/Stargate-API-Skeleton-Tests/StargateApplicationStackTraceDumperTest.class.st @@ -0,0 +1,33 @@ +Class { + #name : #StargateApplicationStackTraceDumperTest, + #superclass : #TestCase, + #category : #'Stargate-API-Skeleton-Tests' +} + +{ #category : #accessing } +StargateApplicationStackTraceDumperTest class >> defaultTimeLimit [ + + ^5 minute +] + +{ #category : #running } +StargateApplicationStackTraceDumperTest >> setUp [ + + super setUp. + StargateApplication logsDirectory ensureCreateDirectory +] + +{ #category : #'tests - application' } +StargateApplicationStackTraceDumperTest >> testStackTraceDumper [ + + | dumper result | + + dumper := PetStoreApplication new stackTraceDumper. + + result := [ 1 / 0 ] on: ZeroDivide + do: [ :zeroDivide | + dumper dumpStackTraceFor: zeroDivide. + zeroDivide return: 5 + ]. + self assert: result equals: 5 +] diff --git a/source/Stargate-API-Skeleton-Tests/StargateApplicationTest.class.st b/source/Stargate-API-Skeleton-Tests/StargateApplicationTest.class.st index 9c0e788..900d0f8 100644 --- a/source/Stargate-API-Skeleton-Tests/StargateApplicationTest.class.st +++ b/source/Stargate-API-Skeleton-Tests/StargateApplicationTest.class.st @@ -5,7 +5,6 @@ Class { #name : #StargateApplicationTest, #superclass : #TestCase, #instVars : [ - 'logger', 'application', 'port', 'baseUrl' @@ -62,7 +61,6 @@ StargateApplicationTest >> secret [ StargateApplicationTest >> setUp [ super setUp. - logger := MemoryLogger new. port := self freeListeningTCPPort. StargateApplication logsDirectory ensureCreateDirectory ] @@ -306,21 +304,6 @@ ENVIRONMENT ' expandMacrosWith: PetStoreApplication version) ] -{ #category : #'tests - application' } -StargateApplicationTest >> testStackTraceDumper [ - - | dumper result | - - dumper := PetStoreApplication new stackTraceDumper. - - result := [ 1 / 0 ] on: ZeroDivide - do: [ :zeroDivide | - dumper dumpStackTraceFor: zeroDivide. - zeroDivide return: 5 - ]. - self assert: result equals: 5 -] - { #category : #'tests - api' } StargateApplicationTest >> testUnsupportedMediaType [ From b216fb6bb8b0a4a94cef00059d84cd689499bb20 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 23 May 2023 16:14:09 -0300 Subject: [PATCH 5/5] Add specifc test class --- .smalltalkci/.unit-tests.ston | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.smalltalkci/.unit-tests.ston b/.smalltalkci/.unit-tests.ston index bad0d06..0ad3239 100644 --- a/.smalltalkci/.unit-tests.ston +++ b/.smalltalkci/.unit-tests.ston @@ -11,6 +11,9 @@ SmalltalkCISpec { #exclude : { #packages : [ 'Stargate-API-Skeleton*'] }, + #include: { + #classes: [ #StargateApplicationTest ] + }, #coverage : { #packages : [ 'Stargate-Application*', @@ -21,6 +24,7 @@ SmalltalkCISpec { 'Stargate-Metrics*', 'Stargate-Model*', 'Stargate-SUnit-Model*' ], + #classes: [ #StargateApplicationTest ], #format: #lcov } }