Skip to content

test rule in Makefile not working #13468

Open
@CyprienRicque

Description

@CyprienRicque

🐛 Bug

make test throw an error when running command: python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v

Makefile test rule failing:

test: clean
	# Review the CONTRIBUTING documentation for other ways to test.
	pip install -e . -r requirements/pytorch/devel.txt
	pip install -r requirements/pytorch/strategies.txt
	# run tests with coverage
	python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v  # Failing command
	python -m coverage report

Error:

========================================= test session starts ==========================================
platform linux -- Python 3.8.3, pytest-7.1.2, pluggy-1.0.0 -- /home/cyprien/anaconda3/envs/lightning383/bin/python
cachedir: .pytest_cache
rootdir: /home/cyprien/Documents/github/lightning, configfile: setup.cfg
plugins: asyncio-0.18.3, forked-1.4.0, rerunfailures-10.2, hydra-core-1.2.0, cov-3.0.0, anyio-3.6.1
asyncio: mode=legacy
collected 0 items                                                                                      

========================================= 16 warnings in 0.01s =========================================
ERROR: file or directory not found: pytorch_lightning

make: *** [Makefile:34: test] Error 4

To Reproduce

To reproduce, follow the Readme.md in tests/ folder:

# clone the repo
git clone https://github.com/Lightning-AI/lightning.git  # Updated link 
cd lightning

# install required depedencies
python -m pip install ".[dev, examples]"

# Old versions compatibility
bash .actions/pull_legacy_checkpoints.sh

# Run test rule
make test  # -> Failing

Expected behavior

The test should start to run as it happens with this command
python -m coverage run --source pytorch_lightning -m pytest src/pytorch_lightning ./tests/tests_pytorch -v
This is command is the same one as in the Makefile but with src/pytorch_lightning instead of pytorch_lightning and ./tests/tests_pytorch instead of ./tests/

Environment

* CUDA:
	- GPU:
		- NVIDIA GeForce RTX 2060
	- available:         True
	- version:           10.2
* Packages:
	- numpy:             1.23.0
	- pyTorch_debug:     False
	- pyTorch_version:   1.11.0+cu102
	- pytorch-lightning: 1.7.0dev
	- tqdm:              4.63.0
* System:
	- OS:                Linux
	- architecture:
		- 64bit
		- ELF
	- processor:         x86_64
	- python:            3.8.3
	- version:           #43-Ubuntu SMP Wed Jun 15 12:54:21 UTC 2022

Additional context

If this not an error from me misusing it, I can create the pull request to fix it.

cc @carmocca @akihironitta @Borda

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingciContinuous Integration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions