Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d6ac070
Add an Improvement plan for tests
diraol Aug 2, 2025
b3909d7
[Preparation] Phase 1 Enhanced Docker Foundation! πŸŽ‰
diraol Aug 2, 2025
ad9fa99
[Preparation ]Phase 2: Modern Test Framework Integration - COMPLETED βœ…
diraol Aug 2, 2025
0692979
[Preparation] Phase 3 Implementation Summary: Advanced Safety Measures
diraol Aug 2, 2025
ee74bd6
[Preparation] Phase 4 Implementation Summary: CI/CD Integration
diraol Aug 2, 2025
be1bda5
[Preparation] Phase 5 Implementation Summary: Performance and Monitoring
diraol Aug 2, 2025
9c46d1a
[Migration] Phase 1: Parallel Implementation
diraol Aug 3, 2025
7d6801e
Phase 2: Gradual Migration - COMPLETED WITH INSIGHTS
diraol Aug 3, 2025
83e9fd0
Improving tests - Phase3 Complete
diraol Aug 4, 2025
bb87c64
🎯 PHASE 4: COMPLETE MIGRATION - COMPLETION ACHIEVED! ✨
diraol Aug 5, 2025
ec72d51
Reduce overengineering
diraol Aug 5, 2025
967ad2a
Remove reference to Phase2
diraol Aug 5, 2025
0c3f994
Fix CICD
diraol Aug 5, 2025
4641db5
Trying to fix CI
diraol Aug 5, 2025
3c44bd5
Using default python image as base
diraol Aug 7, 2025
115fdf2
Remove references to PYTHON_VERSION_SHORT
diraol Aug 7, 2025
5bad803
Simplifying the test structure
diraol Aug 7, 2025
1c04495
Complete test migration and infrastructure improvements
diraol Aug 18, 2025
48c868a
Fix Vader test runner: Install Vader.vim in Dockerfile and improve te…
diraol Nov 14, 2025
e38c401
Document known test failures and investigation steps
diraol Nov 14, 2025
62afecd
Fix all Vader tests and simplify test runner infrastructure
diraol Nov 14, 2025
224faf0
Add test result artifacts to .gitignore
diraol Nov 14, 2025
61ef192
Remove legacy bash tests and update references
diraol Nov 14, 2025
a402982
Simplify test infrastructure: separate local Docker and CI direct exe…
diraol Nov 14, 2025
9273aa2
Fix rope test: ensure rope config variables exist in CI vimrc
diraol Nov 14, 2025
6ef5818
Fix text object assertions in tests
diraol Nov 14, 2025
7a8fa88
Remove legacy test_pymode.yml workflow
diraol Nov 14, 2025
1c878d1
Add cleanup for root-owned files created by Docker containers
diraol Nov 14, 2025
31cbe0c
Add PR comment summary for CI/CD test results
diraol Nov 14, 2025
ec59683
Fix JSON generation and improve error handling in CI/CD scripts
diraol Nov 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Ignore cache directories
**/.ruff_cache/
**/__pycache__/
**/.pytest_cache/
*.pyc
*.pyo

# Ignore version control
.git/
.gitignore

# Ignore swap files
*.swp
*.swo
*~

# Ignore IDE files
.vscode/
.idea/
*.sublime-*

# Ignore build artifacts
.tox/
build/
dist/
*.egg-info/

# Ignore temporary files
*.tmp
*.temp
/tmp/

# Ignore logs
*.log
logs/

# Ignore test outputs
test-results.json
*.vader.out

# Ignore environment files
.env
.env.*
.python-version
76 changes: 0 additions & 76 deletions .github/workflows/build_base_image.yml

This file was deleted.

89 changes: 89 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Python-mode Tests

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
schedule:
- cron: '0 0 * * 0' # Weekly run

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
fail-fast: false

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y vim-nox git

- name: Run Vader test suite
run: |
bash scripts/cicd/run_vader_tests_direct.sh

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.python-version }}
path: |
test-results.json
test-logs/
results/

- name: Upload coverage reports
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: python-${{ matrix.python-version }}

summary:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Download all test results
uses: actions/download-artifact@v4
with:
path: test-results-artifacts
pattern: test-results-*
merge-multiple: false

- name: Install jq for JSON parsing
run: |
sudo apt-get update
sudo apt-get install -y jq

- name: Generate PR summary
id: generate_summary
run: |
bash scripts/cicd/generate_pr_summary.sh test-results-artifacts pr-summary.md
continue-on-error: true

- name: Post PR comment
uses: thollander/actions-comment-pull-request@v3
if: always() && github.event_name == 'pull_request'
with:
file-path: pr-summary.md
comment-tag: test-summary
57 changes: 0 additions & 57 deletions .github/workflows/test_pymode.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,17 @@ vendor
vim.py
vim_session_*.vim
__*/
# Coverage files
.coverage
.coverage.*
coverage.xml
htmlcov/
*.cover
.hypothesis/
.pytest_cache/
# Test result artifacts (generated by test runners)
test-results.json
test-logs/
results/
# Temporary test runner scripts
.tmp_run_test_*.sh
47 changes: 35 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
ARG PYTHON_VERSION_SHORT
ARG PYTHON_VERSION
ARG REPO_OWNER=python-mode
FROM ghcr.io/${REPO_OWNER}/python-mode-base:${PYTHON_VERSION_SHORT}-latest
# Use official Python slim image instead of non-existent base
# Note: For Python 3.13, use 3.13.0 if just "3.13" doesn't work
FROM python:${PYTHON_VERSION}-slim

ENV PYTHON_VERSION=${PYTHON_VERSION}
ENV PYTHONUNBUFFERED=1
ENV PYMODE_DIR="/workspace/python-mode"

# Install system dependencies required for testing
RUN apt-get update && apt-get install -y \
vim-nox \
git \
curl \
bash \
&& rm -rf /var/lib/apt/lists/*

# Install Python coverage tool for code coverage collection
RUN pip install --no-cache-dir coverage

# Set up working directory
WORKDIR /workspace

Expand All @@ -20,21 +31,33 @@ RUN mkdir -p /root/.vim/pack/foo/start/ && \
cp ${PYMODE_DIR}/tests/utils/vimrc /root/.vimrc && \
touch /root/.vimrc.before /root/.vimrc.after

# Install Vader.vim for Vader test framework
RUN mkdir -p /root/.vim/pack/vader/start && \
git clone --depth 1 https://github.com/junegunn/vader.vim.git /root/.vim/pack/vader/start/vader.vim || \
(cd /root/.vim/pack/vader/start && git clone --depth 1 https://github.com/junegunn/vader.vim.git vader.vim)

# Initialize git submodules
WORKDIR /workspace/python-mode

# Create a script to run tests
# Create a simplified script to run tests (no pyenv needed with official Python image)
RUN echo '#!/bin/bash\n\
# export PYENV_ROOT="/opt/pyenv"\n\
# export PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"\n\
eval "$(pyenv init -)"\n\
eval "$(pyenv init --path)"\n\
# Use specified Python version\n\
pyenv shell ${PYTHON_VERSION}\n\
cd /workspace/python-mode\n\
echo "Using Python: $(python --version)"\n\
echo "Using Python: $(python3 --version)"\n\
echo "Using Vim: $(vim --version | head -1)"\n\
bash ./tests/test.sh\n\
rm -f tests/.swo tests/.swp 2>&1 >/dev/null \n\
EXIT_CODE=$?\n\
# Cleanup files that might be created during tests\n\
# Remove Vim swap files\n\
find . -type f -name "*.swp" -o -name "*.swo" -o -name ".*.swp" -o -name ".*.swo" 2>/dev/null | xargs rm -f 2>/dev/null || true\n\
# Remove temporary test scripts\n\
rm -f .tmp_run_test_*.sh 2>/dev/null || true\n\
# Remove Python cache files and directories\n\
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true\n\
find . -type f -name "*.pyc" -o -name "*.pyo" 2>/dev/null | xargs rm -f 2>/dev/null || true\n\
# Remove test artifacts\n\
rm -rf test-logs results 2>/dev/null || true\n\
rm -f test-results.json coverage.xml .coverage .coverage.* 2>/dev/null || true\n\
exit $EXIT_CODE\n\
' > /usr/local/bin/run-tests && \
chmod +x /usr/local/bin/run-tests

Expand Down
Loading