58 lines
1.7 KiB
Ruby
58 lines
1.7 KiB
Ruby
class Allure < Formula
|
|
desc "Flexible lightweight test report tool"
|
|
homepage "https://github.com/allure-framework/allure2"
|
|
url "https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.20.1/allure-commandline-2.20.1.zip"
|
|
sha256 "77a646163712402614d65c03b1e75f669ba1a9a7052bc1336136f1c6b2fe7812"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url "https://search.maven.org/remotecontent?filepath=io/qameta/allure/allure-commandline/maven-metadata.xml"
|
|
regex(%r{<version>v?(\d+(?:\.\d+)+)</version>}i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "dcf570d9180c21fbdd4ce9033a40615e14aa8f65383a587b549f48991455e534"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
# Remove all windows files
|
|
rm_f Dir["bin/*.bat"]
|
|
|
|
prefix.install_metafiles
|
|
libexec.install Dir["*"]
|
|
bin.install Dir["#{libexec}/bin/*"]
|
|
bin.env_script_all_files libexec/"bin", JAVA_HOME: Formula["openjdk"].opt_prefix
|
|
end
|
|
|
|
test do
|
|
(testpath/"allure-results/allure-result.json").write <<~EOS
|
|
{
|
|
"uuid": "allure",
|
|
"name": "testReportGeneration",
|
|
"fullName": "org.homebrew.AllureFormula.testReportGeneration",
|
|
"status": "passed",
|
|
"stage": "finished",
|
|
"start": 1494857300486,
|
|
"stop": 1494857300492,
|
|
"labels": [
|
|
{
|
|
"name": "package",
|
|
"value": "org.homebrew"
|
|
},
|
|
{
|
|
"name": "testClass",
|
|
"value": "AllureFormula"
|
|
},
|
|
{
|
|
"name": "testMethod",
|
|
"value": "testReportGeneration"
|
|
}
|
|
]
|
|
}
|
|
EOS
|
|
system "#{bin}/allure", "generate", "#{testpath}/allure-results", "-o", "#{testpath}/allure-report"
|
|
end
|
|
end
|