Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lask79 committed Feb 19, 2025
1 parent 90de735 commit b32dae5
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/test-antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,24 @@ jobs:
# Ensure Asciidoctor is at ~2.2 as required by Antora
npm install --no-save @asciidoctor/core@~2.2
- name: Test Antora directly
run: |
chmod +x tests/antora/run-antora.sh
./tests/antora/run-antora.sh tests/antora/local-antora-playbook.yml || true
- name: Run Antora tests
env:
ANTORA_LOG_LEVEL: info
DEBUG: antora:*
NODE_ENV: test
run: |
# Print debug info
echo "Working directory: $(pwd)"
echo "Node version: $(node --version)"
echo "NPM version: $(npm --version)"
echo "Antora version: $(npx antora --version)"
# Run tests with full output
npx jest tests/antora --verbose --detectOpenHandles --forceExit \
--config='{"testEnvironment":"node","verbose":true}'
--config='{"testEnvironment":"node","verbose":true}' \
--no-cache --runInBand
10 changes: 10 additions & 0 deletions tests/antora/antora-build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ describe('Antora Extension', () => {
});

test('should complete build without fatal errors', () => {
// Debug: Print current working directory and file existence
console.log('Current working directory:', process.cwd());
console.log('Playbook exists:', fs.existsSync(playbookPath));
console.log('Playbook absolute path:', path.resolve(playbookPath));

// Debug: Print environment variables
console.log('Environment variables:', {
ANTORA_LOG_LEVEL: process.env.ANTORA_LOG_LEVEL,
DEBUG: process.env.DEBUG
});
let output;
try {
// Force logging to be enabled
Expand Down
13 changes: 13 additions & 0 deletions tests/antora/run-antora.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
set -x # Print commands as they are executed

# Print environment info
echo "PWD: $(pwd)"
echo "Node version: $(node --version)"
echo "NPM version: $(npm --version)"

# Try Antora version
npx antora --version

# Run Antora with full output
ANTORA_LOG_LEVEL=info DEBUG=antora:* npx antora --stacktrace --log-level=info "$@"

0 comments on commit b32dae5

Please sign in to comment.