Skip to content

Add edge case tests for ConfigReader#26

Open
mysticBliss wants to merge 3 commits into
mainfrom
test-config-reader-edge-cases-13728690045468486932
Open

Add edge case tests for ConfigReader#26
mysticBliss wants to merge 3 commits into
mainfrom
test-config-reader-edge-cases-13728690045468486932

Conversation

@mysticBliss

Copy link
Copy Markdown
Owner

Added edge case tests for ConfigReader.read_json_files in datamov/core/config_reader/ConfigReader.py.
The new tests are located in tests/test_config_reader.py.
These tests ensure robustness of the configuration reading logic by covering scenarios like empty directories, invalid JSON, and mixed file types.


PR created automatically by Jules for task 13728690045468486932 started by @mysticBliss

Added comprehensive tests for `ConfigReader` covering:
- Valid JSON files.
- Empty directory.
- No JSON files.
- Invalid JSON file (JSONDecodeError).
- Non-existent directory (FileNotFoundError).
- Mixed valid and non-JSON files.

Uses `pytest` and `tmp_path` fixture for isolation.

Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits February 21, 2026 11:24
- Remove module-level `sys.modules` patching in `tests/test_optimization.py` to prevent polluting global state for other tests (e.g., `tests/test_integration.py`).
- Fix `DataMovements.py` to use `self._environments` (private attribute) instead of `self.environments` (non-existent).
- Update `tests/test_data_movements.py` to assert on `dm.environment_configs` (public property) instead of `dm.environments`.
- Correct `tests/test_data_flow_paths.py` to use valid Python expressions for `source_data_format` (e.g., `dt.strftime(...)`) as required by `DataFlow` evaluation logic.
- Fix `tests/test_integration.py` to verify `count()` on the transformed mock DataFrame rather than the unused SQL return value.

Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
- In PySpark 4.0+, `lit()` requires an active SparkContext.
- The `test_integration.py` mocks `SparkSession` but does not establish a real SparkContext.
- Added a patch for `datamov.core.engine.Engine.lit` in `test_engine_run` to prevent `AssertionError` during execution when real `pyspark` is installed.

Co-authored-by: mysticBliss <11345806+mysticBliss@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant