From 33dcdcbde0e9a0da823b293736fc8d83638ce71e Mon Sep 17 00:00:00 2001
From: dan <70999565+belovdv@users.noreply.github.com>
Date: Thu, 3 Sep 2026 14:23:29 +0300
Subject: [PATCH 1/7] [infra] modify testing
---
.github/workflows/ci.yml | 82 +-
.gitignore | 1 +
python/tests/integration/__init__.py | 0
python/tests/integration/copy_.py | 14 +
python/tests/integration/integration.yaml | 859 -------------------
python/tests/integration/test_integration.py | 26 -
ruby/tests/integration/copy.rb | 11 +
ruby/tests/integration/test_integration.rb | 28 -
rust/Cargo.lock | 16 +-
rust/Cargo.toml | 2 +-
rust/copy/Cargo.toml | 8 +
rust/copy/src/main.rs | 5 +
rust/tests/Cargo.toml | 16 -
rust/tests/README.md | 15 -
rust/tests/integration/main.rs | 48 --
scripts/python.sh | 7 +
scripts/round_trip.sh | 15 +
scripts/ruby.sh | 9 +
scripts/rust.sh | 6 +
19 files changed, 118 insertions(+), 1050 deletions(-)
delete mode 100644 python/tests/integration/__init__.py
create mode 100644 python/tests/integration/copy_.py
delete mode 100644 python/tests/integration/integration.yaml
delete mode 100644 python/tests/integration/test_integration.py
create mode 100644 ruby/tests/integration/copy.rb
delete mode 100644 ruby/tests/integration/test_integration.rb
create mode 100644 rust/copy/Cargo.toml
create mode 100644 rust/copy/src/main.rs
delete mode 100644 rust/tests/Cargo.toml
delete mode 100644 rust/tests/README.md
delete mode 100644 rust/tests/integration/main.rs
create mode 100644 scripts/python.sh
create mode 100644 scripts/round_trip.sh
create mode 100644 scripts/ruby.sh
create mode 100644 scripts/rust.sh
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 15ef70c..ccbeff9 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -14,14 +14,9 @@ jobs:
with:
python-version: '3.10'
- run: pip install ruamel.yaml pytest pytest-cov
- - name: Unit tests
- run: pytest python/tests/unit/ -v
- - name: Unit coverage
- run: pytest --cov=python/lira python/tests/unit/ --cov-report=term
- - name: Integration tests
- run: pytest python/tests/integration/ -v
- - name: Diff integration output vs reference
- run: diff python/tests/integration/integration.yaml tests/integration/reference.yaml
+ - run: pip install -e python/
+ - name: Run Python tests (unit, integration, coverage)
+ run: bash scripts/python.sh
ruby-tests:
runs-on: ubuntu-latest
@@ -35,18 +30,8 @@ jobs:
python-version: '3.10'
- run: pip install ruamel.yaml
- run: gem install minitest simplecov
- - name: Unit tests
- run: |
- ruby -I ruby -I ruby/lib ruby/tests/unit/test_ir_ser_txt.rb
- ruby -I ruby -I ruby/lib ruby/tests/unit/test_arch_ser_yaml.rb
- ruby -I ruby -I ruby/lib ruby/tests/unit/test_ir_builder.rb
- - name: Unit coverage
- run: |
- ruby -r simplecov -I ruby -I ruby/lib -e 'SimpleCov.start; Dir["ruby/tests/unit/*.rb"].each { |f| require_relative f }'
- - name: Integration tests
- run: ruby -I ruby -I ruby/lib ruby/tests/integration/test_integration.rb
- - name: Diff integration output vs reference
- run: diff ruby/tests/integration/integration.yaml tests/integration/reference.yaml
+ - name: Run Ruby tests (unit, integration, coverage)
+ run: bash scripts/ruby.sh
rust-tests:
runs-on: ubuntu-latest
@@ -56,36 +41,35 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.10'
+ - run: sudo apt-get update && sudo apt-get install -y z3
- run: pip install ruamel.yaml
- - name: Integration tests
- run: cd rust && cargo test -p lira-tests --test integration
- - name: Diff integration output vs reference
- run: diff rust/tests/integration/integration.yaml tests/integration/reference.yaml
+ - name: Run Rust tests (integration, with coverage)
+ run: bash scripts/rust.sh
- cross-language:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
- with:
- python-version: '3.10'
- - uses: ruby/setup-ruby@v1
- with:
- ruby-version: '3.3'
- - uses: dtolnay/rust-toolchain@stable
- - run: pip install ruamel.yaml pytest
- - run: gem install minitest
+ # cross-language:
+ # runs-on: ubuntu-latest
+ # steps:
+ # - uses: actions/checkout@v4
+ # - uses: actions/setup-python@v5
+ # with:
+ # python-version: '3.10'
+ # - uses: ruby/setup-ruby@v1
+ # with:
+ # ruby-version: '3.3'
+ # - uses: dtolnay/rust-toolchain@stable
+ # - run: pip install ruamel.yaml pytest
+ # - run: gem install minitest
- - name: Python writes native YAML
- run: pytest tests/cross_language/test_cross.py -k "write" -v
- - name: Ruby writes native YAML
- run: ruby -I ruby -I ruby/lib tests/cross_language/test_cross.rb --name test_ruby_write_and_self_read
- - name: Rust writes native YAML
- run: cd rust && cargo test -p lira-tests --test cross_language test_rust_write_and_self_read
+ # - name: Python writes native YAML
+ # run: pytest tests/cross_language/test_cross.py -k "write" -v
+ # - name: Ruby writes native YAML
+ # run: ruby -I ruby -I ruby/lib tests/cross_language/test_cross.rb --name test_ruby_write_and_self_read
+ # - name: Rust writes native YAML
+ # run: cd rust && cargo test -p lira-tests --test cross_language test_rust_write_and_self_read
- - name: Python reads Ruby and Rust
- run: pytest tests/cross_language/test_cross.py -k "reads" -v
- - name: Ruby reads Python and Rust
- run: ruby -I ruby -I ruby/lib tests/cross_language/test_cross.rb --name '/test_ruby_reads/'
- - name: Rust reads Python and Ruby
- run: cd rust && cargo test -p lira-tests --test cross_language test_rust_reads
+ # - name: Python reads Ruby and Rust
+ # run: pytest tests/cross_language/test_cross.py -k "reads" -v
+ # - name: Ruby reads Python and Rust
+ # run: ruby -I ruby -I ruby/lib tests/cross_language/test_cross.rb --name '/test_ruby_reads/'
+ # - name: Rust reads Python and Ruby
+ # run: cd rust && cargo test -p lira-tests --test cross_language test_rust_reads
diff --git a/.gitignore b/.gitignore
index 915133f..85ca188 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ htmlcov/
*.log
.env
build/
+tmp/
diff --git a/python/tests/integration/__init__.py b/python/tests/integration/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/python/tests/integration/copy_.py b/python/tests/integration/copy_.py
new file mode 100644
index 0000000..f584e6a
--- /dev/null
+++ b/python/tests/integration/copy_.py
@@ -0,0 +1,14 @@
+assert __name__ == '__main__'
+
+import sys
+from pathlib import Path
+
+from lira import arch_ser_yaml
+
+assert len(sys.argv) == 3, 'copy.py