Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid interactions through test artifacts #19821

Merged
merged 13 commits into from Apr 28, 2024
Merged

Conversation

awaelchli
Copy link
Member

@awaelchli awaelchli commented Apr 27, 2024

What does this PR do?

In #19706 I noticed a test interaction through a checkpoint dir or log dir that was saved to cwd instead of tmp_path (I don't remember which ones). So I decided to write a safety guard against that in conftest.py.


📚 Documentation preview 📚: https://pytorch-lightning--19821.org.readthedocs.build/en/19821/

cc @Borda @carmocca @justusschock @awaelchli

@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Apr 27, 2024
@awaelchli awaelchli added tests fun Staff contributions outside working hours - to differentiate from the "community" label and removed fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Apr 27, 2024
Copy link
Contributor

github-actions bot commented Apr 27, 2024

⚡ Required checks status: All passing 🟢

Groups summary

🟢 pytorch_lightning: Tests workflow
Check ID Status
pl-cpu (macOS-11, lightning, 3.8, 2.0, oldest) success
pl-cpu (macOS-11, lightning, 3.10, 2.0) success
pl-cpu (macOS-11, lightning, 3.10, 2.1) success
pl-cpu (macOS-11, lightning, 3.10, 2.2) success
pl-cpu (ubuntu-20.04, lightning, 3.8, 2.0, oldest) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 2.0) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 2.1) success
pl-cpu (ubuntu-20.04, lightning, 3.10, 2.2) success
pl-cpu (windows-2022, lightning, 3.8, 2.0, oldest) success
pl-cpu (windows-2022, lightning, 3.10, 2.0) success
pl-cpu (windows-2022, lightning, 3.10, 2.1) success
pl-cpu (windows-2022, lightning, 3.10, 2.2) success
pl-cpu (macOS-11, pytorch, 3.8, 2.0) success
pl-cpu (ubuntu-20.04, pytorch, 3.8, 2.0) success
pl-cpu (windows-2022, pytorch, 3.8, 2.0) success
pl-cpu (macOS-12, pytorch, 3.11, 2.0) success
pl-cpu (macOS-12, pytorch, 3.11, 2.1) success
pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.0) success
pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.1) success
pl-cpu (windows-2022, pytorch, 3.11, 2.0) success
pl-cpu (windows-2022, pytorch, 3.11, 2.1) success

These checks are required after the changes to tests/tests_pytorch/__init__.py, tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py, tests/tests_pytorch/callbacks/progress/test_tqdm_progress_bar.py, tests/tests_pytorch/callbacks/test_device_stats_monitor.py, tests/tests_pytorch/callbacks/test_finetuning_callback.py, tests/tests_pytorch/callbacks/test_prediction_writer.py, tests/tests_pytorch/callbacks/test_pruning.py, tests/tests_pytorch/callbacks/test_spike.py, tests/tests_pytorch/callbacks/test_timer.py, tests/tests_pytorch/checkpointing/test_checkpoint_callback_frequency.py, tests/tests_pytorch/conftest.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/core/test_lightning_optimizer.py, tests/tests_pytorch/core/test_metric_result_integration.py, tests/tests_pytorch/core/test_saving.py, tests/tests_pytorch/helpers/datasets.py, tests/tests_pytorch/helpers/test_datasets.py, tests/tests_pytorch/helpers/utils.py, tests/tests_pytorch/loggers/test_all.py, tests/tests_pytorch/loggers/test_csv.py, tests/tests_pytorch/loggers/test_neptune.py, tests/tests_pytorch/loops/test_training_epoch_loop.py, tests/tests_pytorch/models/test_restore.py, tests/tests_pytorch/plugins/precision/test_double.py, tests/tests_pytorch/serve/test_servable_module_validator.py, tests/tests_pytorch/strategies/launchers/test_multiprocessing.py, tests/tests_pytorch/strategies/test_ddp_integration.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/flags/test_env_vars.py, tests/tests_pytorch/trainer/flags/test_min_max_epochs.py, tests/tests_pytorch/trainer/flags/test_val_check_interval.py, tests/tests_pytorch/trainer/optimization/test_backward_calls.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/optimization/test_multiple_optimizers.py, tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py, tests/tests_pytorch/trainer/test_dataloaders.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/tuner/test_scale_batch_size.py.

🟢 pytorch_lightning: Azure GPU
Check ID Status
pytorch-lightning (GPUs) (testing Lightning | latest) success
pytorch-lightning (GPUs) (testing PyTorch | latest) success

These checks are required after the changes to tests/tests_pytorch/__init__.py, tests/tests_pytorch/callbacks/progress/test_rich_progress_bar.py, tests/tests_pytorch/callbacks/progress/test_tqdm_progress_bar.py, tests/tests_pytorch/callbacks/test_device_stats_monitor.py, tests/tests_pytorch/callbacks/test_finetuning_callback.py, tests/tests_pytorch/callbacks/test_prediction_writer.py, tests/tests_pytorch/callbacks/test_pruning.py, tests/tests_pytorch/callbacks/test_spike.py, tests/tests_pytorch/callbacks/test_timer.py, tests/tests_pytorch/checkpointing/test_checkpoint_callback_frequency.py, tests/tests_pytorch/conftest.py, tests/tests_pytorch/core/test_datamodules.py, tests/tests_pytorch/core/test_lightning_optimizer.py, tests/tests_pytorch/core/test_metric_result_integration.py, tests/tests_pytorch/core/test_saving.py, tests/tests_pytorch/helpers/datasets.py, tests/tests_pytorch/helpers/test_datasets.py, tests/tests_pytorch/helpers/utils.py, tests/tests_pytorch/loggers/test_all.py, tests/tests_pytorch/loggers/test_csv.py, tests/tests_pytorch/loggers/test_neptune.py, tests/tests_pytorch/loops/test_training_epoch_loop.py, tests/tests_pytorch/models/test_restore.py, tests/tests_pytorch/plugins/precision/test_double.py, tests/tests_pytorch/serve/test_servable_module_validator.py, tests/tests_pytorch/strategies/launchers/test_multiprocessing.py, tests/tests_pytorch/strategies/test_ddp_integration.py, tests/tests_pytorch/strategies/test_fsdp.py, tests/tests_pytorch/strategies/test_registry.py, tests/tests_pytorch/trainer/flags/test_env_vars.py, tests/tests_pytorch/trainer/flags/test_min_max_epochs.py, tests/tests_pytorch/trainer/flags/test_val_check_interval.py, tests/tests_pytorch/trainer/optimization/test_backward_calls.py, tests/tests_pytorch/trainer/optimization/test_manual_optimization.py, tests/tests_pytorch/trainer/optimization/test_multiple_optimizers.py, tests/tests_pytorch/trainer/properties/test_estimated_stepping_batches.py, tests/tests_pytorch/trainer/test_dataloaders.py, tests/tests_pytorch/trainer/test_trainer.py, tests/tests_pytorch/tuner/test_scale_batch_size.py.

🟢 lightning_fabric: CPU workflow
Check ID Status
fabric-cpu (macOS-11, lightning, 3.8, 2.0, oldest) success
fabric-cpu (macOS-11, lightning, 3.10, 2.0) success
fabric-cpu (macOS-11, lightning, 3.11, 2.1) success
fabric-cpu (macOS-11, lightning, 3.11, 2.2) success
fabric-cpu (ubuntu-20.04, lightning, 3.8, 2.0, oldest) success
fabric-cpu (ubuntu-20.04, lightning, 3.10, 2.0) success
fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.1) success
fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2) success
fabric-cpu (windows-2022, lightning, 3.8, 2.0, oldest) success
fabric-cpu (windows-2022, lightning, 3.10, 2.0) success
fabric-cpu (windows-2022, lightning, 3.11, 2.1) success
fabric-cpu (windows-2022, lightning, 3.11, 2.2) success
fabric-cpu (macOS-11, fabric, 3.8, 2.0) success
fabric-cpu (ubuntu-20.04, fabric, 3.8, 2.0) success
fabric-cpu (windows-2022, fabric, 3.8, 2.0) success
fabric-cpu (macOS-12, fabric, 3.11, 2.0) success
fabric-cpu (macOS-12, fabric, 3.11, 2.1) success
fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.0) success
fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.1) success
fabric-cpu (windows-2022, fabric, 3.11, 2.0) success
fabric-cpu (windows-2022, fabric, 3.11, 2.1) success

These checks are required after the changes to tests/tests_fabric/conftest.py.

🟢 lightning_fabric: Azure GPU
Check ID Status
lightning-fabric (GPUs) (testing Fabric | latest) success
lightning-fabric (GPUs) (testing Lightning | latest) success

These checks are required after the changes to tests/tests_fabric/conftest.py.


Thank you for your contribution! 💜

Note
This comment is automatically generated and updates for 60 minutes every 180 seconds. If you have any other questions, contact carmocca for help.

@awaelchli awaelchli added this to the 2.3 milestone Apr 27, 2024
@github-actions github-actions bot added fabric lightning.fabric.Fabric pl Generic label for PyTorch Lightning package labels Apr 27, 2024
Copy link

codecov bot commented Apr 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59%. Comparing base (5e0e02b) to head (ec23e68).

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #19821     +/-   ##
=========================================
- Coverage      84%      59%    -25%     
=========================================
  Files         424      419      -5     
  Lines       34698    34600     -98     
=========================================
- Hits        29153    20248   -8905     
- Misses       5545    14352   +8807     

@awaelchli awaelchli changed the title WIP: Avoid interactions through test artifacts Avoid interactions through test artifacts Apr 27, 2024
Copy link
Member

@carmocca carmocca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

@mergify mergify bot added the ready PRs ready to be merged label Apr 28, 2024
@awaelchli awaelchli merged commit 2913633 into master Apr 28, 2024
61 checks passed
@awaelchli awaelchli deleted the tests/avoid-artifacts branch April 28, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fabric lightning.fabric.Fabric fun Staff contributions outside working hours - to differentiate from the "community" label pl Generic label for PyTorch Lightning package ready PRs ready to be merged tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants