-
-
Notifications
You must be signed in to change notification settings - Fork 470
HTTP spec conformance during CI #3169
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
Closed
Closed
Changes from 11 commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
da4da1b
add process for conformance suite
Saturn225 969afa9
workflow for conformance suite added
Saturn225 698dd7c
fix(conformance): forbidden duplicate headers
Saturn225 bb47958
fix(conformance): tests and move to other suite for e2e validation
Saturn225 453c609
chore: cleanup and fix 404 and 405 tests
Saturn225 73a209b
Update ServerInboundHandler.scala
Saturn225 1e66f64
Update Routes.scala
Saturn225 1948dc4
feat(conformance): 404
Saturn225 6514ff7
chore(conformance): cleanup netty exception tests
Saturn225 943167c
fix(conformance): fmt
Saturn225 5257f23
remove netty exceptions added
Saturn225 b609cd9
fix
Saturn225 62e78a3
feat(conformance): add review comments
Saturn225 70d026e
Merge branch 'test-1' into feat/conformance-spec
Saturn225 f2ccf4a
Handle OPTIONS Method
Saturn225 66dbe0d
fix in TestServer for validation
Saturn225 864d676
remove dev logs
Saturn225 6a29249
Merge branch 'main' into feat/conformance-spec
Saturn225 957b35f
fix: conformance tests
Saturn225 265e7e6
Merge branch 'main' into feat/conformance-spec
987Nabil 9b0638e
Merge branch 'main' into feat/conformance-spec
Saturn225 ab4f1fd
Merge branch 'main' into feat/conformance-spec
Saturn225 e165ef1
Relax Host header validation logic to allow broader compatibility
Saturn225 078c76b
Merge branch 'main' into feat/conformance-spec
987Nabil 769e451
update build pipeline for conformance tests
Saturn225 ecd6797
Merge branch 'main' into feat/conformance-spec
Saturn225 bcca045
Merge branch 'main' into feat/conformance-spec
Saturn225 a19b7e6
Merge branch 'main' into feat/conformance-spec
Saturn225 58910d9
Merge branch 'main' into feat/conformance-spec
Saturn225 1725131
Merge branch 'main' into feat/conformance-spec
Saturn225 7f74dbb
Merge branch 'main' into feat/conformance-spec
Saturn225 19b88e9
Merge branch 'main' into feat/conformance-spec
Saturn225 87194e9
Merge branch 'main' into feat/conformance-spec
Saturn225 8a50242
mark as private
Saturn225 0e0f746
feat: add review suggestions
Saturn225 a9dd62f
cleanup
Saturn225 fb1db92
fmt
Saturn225 4b2cd8a
ignore test for missing header to add 401 Unauthorized
Saturn225 591d7e5
fmt
Saturn225 8f510fe
Trigger Build
Saturn225 c8cc909
Merge branch 'main' into feat/conformance-spec
987Nabil 12a4b8f
Merge branch 'main' into feat/conformance-spec
Saturn225 eff361b
cleanup
Saturn225 fdd1657
provide scope
Saturn225 5623ceb
fix build
Saturn225 8361979
Merge branch 'main' into feat/conformance-spec
Saturn225 0b8abb5
Merge branch 'main' into feat/conformance-spec
Saturn225 a532d1f
Merge branch 'main' into feat/conformance-spec
Saturn225 91e58b4
Merge branch 'main' into feat/conformance-spec
Saturn225 0d11203
re-trigger build
Saturn225 1743b79
Merge branch 'main' into feat/conformance-spec
Saturn225 f5e97bb
Merge branch 'zio:main' into feat/conformance-spec
Saturn225 f5f7eb2
feat(server): add `validateHeaders` config flag to control built-in a…
Saturn225 6256e79
make mima happier
Saturn225 72b31c3
Merge branch 'main' into feat/conformance-spec
Saturn225 c116e86
Merge branch 'main' into feat/conformance-spec
Saturn225 cf3a4d8
Merge branch 'main' into feat/conformance-spec
Saturn225 23f4eeb
fix: fmt
Saturn225 753ad19
Merge branch 'main' into feat/conformance-spec
Saturn225 6573ae7
Merge branch 'main' into feat/conformance-spec
Saturn225 36abd38
Merge branch 'main' into feat/conformance-spec
Saturn225 bc4be4a
Merge branch 'main' into feat/conformance-spec
Saturn225 f18f58d
Merge branch 'main' into feat/conformance-spec
Saturn225 598cf84
Merge branch 'main' into feat/conformance-spec
987Nabil 2ba8dcd
Merge branch 'main' into feat/conformance-spec
Saturn225 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: HTTP Conformance | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["**"] | ||
| push: | ||
| branches: ["**"] | ||
| tags: [v*] | ||
|
|
||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| JDK_JAVA_OPTIONS: "-Xms4G -Xmx8G -XX:+UseG1GC -Xss10M -XX:ReservedCodeCacheSize=1G -XX:NonProfiledCodeHeapSize=512m -Dfile.encoding=UTF-8" | ||
| SBT_OPTS: "-Xms4G -Xmx8G -XX:+UseG1GC -Xss10M -XX:ReservedCodeCacheSize=1G -XX:NonProfiledCodeHeapSize=512m -Dfile.encoding=UTF-8" | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build and Test | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest] | ||
| scala: [2.12.19, 2.13.14, 3.3.3] | ||
| java: | ||
| - graal_graalvm@17 | ||
| - graal_graalvm@21 | ||
| - temurin@17 | ||
| - temurin@21 | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 60 | ||
|
|
||
| steps: | ||
| - name: Checkout current branch (full) | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Setup GraalVM (graal_graalvm@17) | ||
| if: matrix.java == 'graal_graalvm@17' | ||
| uses: graalvm/setup-graalvm@v1 | ||
| with: | ||
| java-version: 17 | ||
| distribution: graalvm | ||
| components: native-image | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| cache: sbt | ||
|
|
||
| - name: Setup GraalVM (graal_graalvm@21) | ||
| if: matrix.java == 'graal_graalvm@21' | ||
| uses: graalvm/setup-graalvm@v1 | ||
| with: | ||
| java-version: 21 | ||
| distribution: graalvm | ||
| components: native-image | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| cache: sbt | ||
|
|
||
| - name: Setup Java (temurin@17) | ||
| if: matrix.java == 'temurin@17' | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 17 | ||
| cache: sbt | ||
|
|
||
| - name: Setup Java (temurin@21) | ||
| if: matrix.java == 'temurin@21' | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: temurin | ||
| java-version: 21 | ||
| cache: sbt | ||
|
|
||
| - name: Run HTTP Conformance Tests | ||
| run: sbt "project zioHttpJVM" "testOnly zio.http.ConformanceSpec zio.http.ConformanceE2ESpec" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
zio-http/jvm/src/test/scala/zio/http/ConformanceE2ESpec.scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| package zio.http | ||
|
|
||
| import zio._ | ||
| import zio.test.Assertion._ | ||
| import zio.test.TestAspect._ | ||
| import zio.test._ | ||
|
|
||
| import zio.http._ | ||
| import zio.http.internal.{DynamicServer, RoutesRunnableSpec} | ||
| import zio.http.netty.NettyConfig | ||
|
|
||
| object ConformanceE2ESpec extends RoutesRunnableSpec { | ||
|
|
||
| private val port = 8080 | ||
| private val MaxSize = 1024 * 10 | ||
| val configApp = Server.Config.default | ||
| .requestDecompression(true) | ||
| .disableRequestStreaming(MaxSize) | ||
| .port(port) | ||
| .responseCompression() | ||
|
|
||
| private val app = serve | ||
|
|
||
| def conformanceSpec = suite("ConformanceE2ESpec")( | ||
| test("should return 400 Bad Request if Host header is missing") { | ||
| val routes = Handler.ok.toRoutes | ||
|
|
||
| val res = routes.deploy.status.run(path = Path.root, headers = Headers(Header.Host("%%%%invalid%%%%"))) | ||
| assertZIO(res)(equalTo(Status.BadRequest)) | ||
| }, | ||
| test("should return 200 OK if Host header is present") { | ||
| val routes = Handler.ok.toRoutes | ||
|
|
||
| val res = routes.deploy.status.run(path = Path.root, headers = Headers(Header.Host("localhost"))) | ||
| assertZIO(res)(equalTo(Status.Ok)) | ||
| }, | ||
| ) | ||
|
|
||
| override def spec = | ||
| suite("ConformanceE2ESpec") { | ||
| val spec = conformanceSpec | ||
| suite("app without request streaming") { app.as(List(spec)) } | ||
| }.provideShared( | ||
| DynamicServer.live, | ||
| ZLayer.succeed(configApp), | ||
| Server.customized, | ||
| Client.default, | ||
| ZLayer.succeed(NettyConfig.default), | ||
| ) @@ sequential @@ withLiveClock | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.