Skip to content
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

try h2spec 2.6.0 #263

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 5 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import org.apache.pekko
import pekko._
import pekko.ValidatePullRequest._
import PekkoDependency._
import Dependencies.{ h2specExe, h2specName }
import Dependencies.{ h2specArtifactExtension, h2specExe, h2specName }
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
import java.nio.file.Files
import java.nio.file.attribute.{ PosixFileAttributeView, PosixFilePermission }
Expand Down Expand Up @@ -188,7 +188,10 @@ lazy val http2Tests = project("http2-tests")
log.info("Extracting h2spec to " + h2spec)

for (zip <- (Test / update).value.select(artifact = artifactFilter(name = h2specName, extension = "zip")))
IO.unzip(zip, (Test / target).value)
IO.unzip(zip, (Test / target).value / h2specName)

for (tarGz <- (Test / update).value.select(artifact = artifactFilter(name = h2specName, extension = "gz")))
Untar.unTarGz(tarGz, (Test / target).value / h2specName)

// Set the executable bit on the expected path to fail if it doesn't exist
for (view <- Option(Files.getFileAttributeView(h2spec.toPath, classOf[PosixFileAttributeView]))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@
else
s"pass rule: $name" in {
runSpec(specSectionNumber = Some(sectionNr),
junitOutput = new File(s"target/test-reports/h2spec-junit-$sectionNr.xml"))

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.12, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 154 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (2.13, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)
}

Check failure on line 155 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (3.3, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 155 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (3.3, 11)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 155 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (3.3, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)

Check failure on line 155 in http2-tests/src/test/scala/org/apache/pekko/http/impl/engine/http2/H2SpecIntegrationSpec.scala

View workflow job for this annotation

GitHub Actions / Compile and test (3.3, 8)

org.scalatest.exceptions.TestFailedException: "Hypertext Transfer Protocol Version 2 (HTTP/2)
}
}
// end of execution of tests -----------------------------------------------------------
Expand All @@ -171,7 +171,7 @@
"-k", "-t",
"-p", port.toString,
"-j", junitOutput.getPath) ++
specSectionNumber.toList.flatMap(number => Seq("-s", number))
specSectionNumber.toList.map(number => s"http2/$number")

log.debug(s"Executing h2spec: $command")
val aggregateTckLogs = ProcessLogger(
Expand Down
9 changes: 5 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ object Dependencies {
val jacksonDatabindVersion = "2.14.3"
val jacksonXmlVersion = jacksonDatabindVersion
val junitVersion = "4.13.2"
val h2specVersion = "1.5.0"
val h2specVersion = "2.6.0"
val h2specName = s"h2spec_${DependencyHelpers.osName}_amd64"
val h2specExe = "h2spec" + DependencyHelpers.exeIfWindows
val h2specUrl = s"https://github.com/summerwind/h2spec/releases/download/v$h2specVersion/$h2specName.zip"
val h2specArtifactExtension = if (h2specExe == "exe") "zip" else "tar.gz"
val h2specUrl =
s"https://github.com/summerwind/h2spec/releases/download/v$h2specVersion/$h2specName.$h2specArtifactExtension"

val scalaTestVersion = "3.2.14"
val specs2Version = "4.10.6"
Expand Down Expand Up @@ -186,8 +188,7 @@ object DependencyHelpers {
}

def exeIfWindows: String = {
val os = System.getProperty("os.name").toLowerCase()
if (os.startsWith("win")) ".exe"
if (osName.startsWith("win")) ".exe"
else ""
}

Expand Down
48 changes: 48 additions & 0 deletions project/Untar.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.pekko

import org.apache.commons.compress.archivers.tar.TarArchiveInputStream
import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream
import org.apache.commons.io.IOUtils

import java.io.{ BufferedInputStream, File, FileInputStream, FileOutputStream }
import scala.util.Using

object Untar {

// extracts files from `.tar.gz` / `.tgz` files
def unTarGz(tarFile: File, toDirectory: File): Unit = {
Using(new FileInputStream(tarFile)) { tarFileStream =>
val buffIn = new BufferedInputStream(tarFileStream)
val gzIn = new GzipCompressorInputStream(buffIn)
Using(new TarArchiveInputStream(gzIn)) { tis =>
toDirectory.mkdirs()
var entry = tis.getNextTarEntry
while (entry ne null) {
val name = entry.getName
val outFile = new File(toDirectory, name)
Using(new FileOutputStream(outFile)) { fos =>
IOUtils.copy(tis, fos)
}
entry = tis.getNextTarEntry
}
}
}
}
}
Loading