Skip to content

Commit ab08122

Browse files
build: fix test cli config (#1483)
* build: fix test cli config * build: fix e2e test failures by adding missing test data and fixing port conflict Add untracked test data files (config.json, sample.py, utils.js) needed by allExternalDeps test. Fix mermaidLinks port collision with httpTracking (both used 3461) and add missing server cleanup scenario. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * build: rename doc-artifacts to test-doc-artifacts to avoid gitignore The root .gitignore excludes doc-artifacts, preventing test data files (app.config, schema.graphql) from being committed. Rename to test-doc-artifacts and update lookup-paths and test expectations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1d68d9b commit ab08122

11 files changed

Lines changed: 34 additions & 5 deletions

File tree

znai-cli/src/test/groovy/org/testingisdocumenting/znai/cli/ZnaiCliConfigTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class ZnaiCliConfigTest {
9494
OptionKey.MARKUP_TYPE,
9595
OptionKey.HELP,
9696
OptionKey.VERSION,
97+
OptionKey.ALL_EXTERNAL_DEPS_FILE_PATH,
9798
OptionKey.VALIDATE_EXTERNAL_LINKS,
9899
OptionKey.ACTOR,
99100
OptionKey.MODIFIED_TIME,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"key": "value",
3+
"nested": {
4+
"enabled": true
5+
}
6+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def hello():
2+
print("hello world")
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
../doxygen.zip
2-
../doc-artifacts
2+
../test-doc-artifacts
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function formatDate(d) {
2+
return d.toISOString();
3+
}

znai-tests/src/test/groovy/scenarios/allExternalDeps.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ scenario('build sampledoc with all external dependencies file') {
2727
"--source=${cfg.fullPath('sampledoc')} " +
2828
"--all-external-dependencies-file-path $depsFilePath")
2929

30-
fs.textContent(depsFilePath).should == '../doc-artifacts/app.config\n' +
31-
'../doc-artifacts/schema.graphql\n' +
30+
fs.textContent(depsFilePath).should == '../test-doc-artifacts/app.config\n' +
31+
'../test-doc-artifacts/schema.graphql\n' +
3232
'chapter-one/config.json\n' +
3333
'chapter-two/sample.py\n' +
3434
'utils.js'

znai-tests/src/test/groovy/scenarios/mermaidLinks.groovy

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ import static clicommands.CliCommands.getZnai
2020
import static org.testingisdocumenting.webtau.WebTauGroovyDsl.*
2121
import static pages.Pages.*
2222

23-
def port = 3461
23+
def port = 3462
24+
25+
def znaiPreview
2426

2527
scenario("run znai preview for mermaid links") {
26-
def znaiPreview = znai.runInBackground(
28+
znaiPreview = znai.runInBackground(
2729
"--source=${cfg.fullPath("sampledoc")} --port=$port --preview")
2830
znaiPreview.output.waitTo(contain("server started"), 20_000)
2931
}
@@ -50,3 +52,9 @@ scenario("click mermaid link and browser back restores scroll position") {
5052
docContent.title.waitTo == "Mermaid Diagrams"
5153
docContent.mainPanelScrollTop.waitTo == scrollTopBeforeClick
5254
}
55+
56+
scenario("stop mermaid preview server") {
57+
if (znaiPreview) {
58+
znaiPreview.stop()
59+
}
60+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server.port=8080
2+
server.host=localhost
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"shapes" : [ ],
3+
"pixelRatio" : 2
4+
}
238 KB
Loading

0 commit comments

Comments
 (0)