homebrew-core/Formula/allure.rb

54 lines
1.5 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.14.0/allure-commandline-2.14.0.zip"
sha256 "cb29774639978ed971c18c01ade6ce676a70a275787874fed0d5a9c6163308b1"
license "Apache-2.0"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "e86e332615375396adbb57492fbf12d517c3a77589c9d7c4b991a834ba4060fb"
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