homebrew-core/Formula/allure.rb

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.21.0/allure-commandline-2.21.0.zip"
sha256 "ccc066e4fd3bec77d4a15df39f237dc758d9edcf40ebd71c85efc76c7aa2feed"
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: "5507193e2a2b873a4051c5c164527f09f8653fa0a67ffb73504d58c884f11797"
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