Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-playwright-web-spd
Commits
39cf33bd
Commit
39cf33bd
authored
Sep 15, 2026
by
liguangyu06
Browse files
Use Windows Allure CLI and a Jenkins-managed commandline so Allure reports generate on CI.
parent
93e5410e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Jenkinsfile
View file @
39cf33bd
...
...
@@ -220,7 +220,7 @@ pipeline {
}
try
{
if
(
fileExists
(
'reports/latest/allure-results'
))
{
allure
includeProperties:
false
,
jdk:
''
,
results:
[[
path:
'reports/latest/allure-results'
]]
allure
commandline:
'allure'
,
includeProperties:
false
,
jdk:
''
,
results:
[[
path:
'reports/latest/allure-results'
]]
}
else
{
echo
'无 allure-results,跳过 Allure 插件报告。'
}
...
...
scripts/run-ci.mjs
View file @
39cf33bd
...
...
@@ -157,12 +157,21 @@ function tryGenerateAllure(resultsDir, reportDir) {
console
.
log
(
'
[allure] 无 results,跳过 generate
'
);
return
false
;
}
const
cli
=
path
.
join
(
ROOT
,
'
node_modules/allure-commandline/bin/allure
'
);
const
cmd
=
existsSync
(
cli
)
?
cli
:
'
allure
'
;
const
bat
=
path
.
join
(
ROOT
,
'
node_modules/allure-commandline/dist/bin/allure.bat
'
);
const
unix
=
path
.
join
(
ROOT
,
'
node_modules/allure-commandline/bin/allure
'
);
const
cmd
=
process
.
platform
===
'
win32
'
&&
existsSync
(
bat
)
?
bat
:
existsSync
(
unix
)
?
unix
:
'
allure
'
;
const
env
=
{
...
process
.
env
};
if
(
!
env
.
JAVA_HOME
)
{
env
.
JAVA_HOME
=
'
E:
\\
Program Files
\\
Java
\\
jdk-11
'
;
}
const
javaBin
=
path
.
join
(
env
.
JAVA_HOME
,
'
bin
'
);
env
.
PATH
=
`
${
javaBin
}${
path
.
delimiter
}${
env
.
PATH
||
''
}
`
;
console
.
log
(
`[allure] generate via
${
cmd
}
`
);
const
result
=
spawnSync
(
cmd
,
[
'
generate
'
,
resultsDir
,
'
-o
'
,
reportDir
,
'
--clean
'
],
{
cwd
:
ROOT
,
stdio
:
'
inherit
'
,
env
:
process
.
env
,
env
,
shell
:
process
.
platform
===
'
win32
'
,
});
if
(
result
.
status
!==
0
)
{
console
.
warn
(
'
[allure] generate 失败(常见原因:节点未装 Java)。Playwright HTML / JUnit 仍可用。
'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment