Skip to content

Commit e4ca7e3

Browse files
committed
Add Makefile targets for updating testing docs
Introduces new Makefile targets to automate the process of updating testing documentation, including installing repomix, generating repomix output, processing documentation, and cleaning up temporary files. Also renames and updates the GitHub workflow to instruct contributors to use the new Makefile command for documentation updates.
1 parent 118a874 commit e4ca7e3

File tree

2 files changed

+35
-10
lines changed

2 files changed

+35
-10
lines changed

.github/workflows/validate_testing_docs.yml renamed to .github/workflows/validate_testing_docs_on_change.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Validate Testing Documentation
1+
name: Validate Testing Documentation for changes
22

33
on:
44
pull_request:
@@ -43,19 +43,22 @@ jobs:
4343
4444
We detected changes in the `shiny/playwright/controller` directory. These changes may affect the testing documentation used by the `shiny add test` command.
4545
46-
**Please run the following commands to update the testing documentation:**
46+
**Please run the following command to update the testing documentation:**
4747
4848
```bash
49-
# Install repomix if not already installed
50-
npm install -g repomix
49+
make update-testing-docs
50+
```
5151
52-
# Generate updated testing documentation
53-
repomix docs/api/testing -o tests/inspect-ai/utils/scripts/repomix-output-testing.xml
54-
python tests/inspect-ai/utils/scripts/process_docs.py --input tests/inspect-ai/utils/scripts/repomix-output-testing.xml --output shiny/pytest/generate/data/docs/documentation_testing.json
52+
<details><summary>Additional details</summary>
5553
56-
# Clean up temporary files
57-
rm -f tests/inspect-ai/utils/scripts/repomix-output-testing.xml
58-
```
54+
This command will:
55+
1. Install repomix if not already installed
56+
2. Build the latest documentation with quartodoc
57+
3. Generate repomix output for testing docs
58+
4. Process the output to update the AI test generator documentation
59+
5. Clean up temporary files
60+
61+
</details>
5962
6063
This will ensure that the AI test generator has access to the latest controller API documentation.
6164

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,28 @@ docs-quartodoc: FORCE
123123
@echo "-------- Making quartodoc docs --------"
124124
@cd docs && make quartodoc
125125

126+
install-repomix: install-npm ## Install repomix if not already installed
127+
@echo "-------- Installing repomix if needed --------"
128+
@if ! npm list -g repomix > /dev/null 2>&1; then \
129+
echo "Installing repomix..."; \
130+
npm install -g repomix; \
131+
else \
132+
echo "repomix is already installed"; \
133+
fi
134+
135+
update-testing-docs-repomix: install-repomix ## Generate repomix output for testing docs
136+
@echo "-------- Generating repomix output for testing docs --------"
137+
repomix docs/api/testing -o tests/inspect-ai/utils/scripts/repomix-output-testing.xml
138+
139+
update-testing-docs-process: ## Process repomix output to generate testing documentation JSON
140+
@echo "-------- Processing testing documentation --------"
141+
python tests/inspect-ai/utils/scripts/process_docs.py --input tests/inspect-ai/utils/scripts/repomix-output-testing.xml --output shiny/pytest/generate/data/docs/documentation_testing.json
142+
@echo "-------- Cleaning up temporary files --------"
143+
rm -f tests/inspect-ai/utils/scripts/repomix-output-testing.xml
144+
145+
update-testing-docs: docs update-testing-docs-repomix update-testing-docs-process ## Update testing documentation (full pipeline)
146+
@echo "-------- Testing documentation update complete --------"
147+
126148

127149
install-npm: FORCE
128150
$(if $(shell which npm), @echo -n, $(error Please install node.js and npm first. See https://nodejs.org/en/download/ for instructions.))

0 commit comments

Comments
 (0)