I am trying to learn CircleCI but must say, finding it very difficult to use. I am trying to run my Selenium project code written in Python language but getting pytest: command not found error. I have mentioned the PyTest installation in my requirement.txt file, I also tried to install the PyTest by running the below command but still getting the same error.
JavaScript
x
2
1
- run: pip install pytest --user
2
Here is my config.yml file
JavaScript
1
31
31
1
version: 2.1
2
3
orbs:
4
python: circleci/python@2.0.3
5
6
7
jobs:
8
example-job:
9
10
11
docker:
12
- image: circleci/python:3.6.1
13
14
15
steps:
16
- checkout
17
- run: pip install pytest --user
18
- python/install-packages:
19
args: pytest --user
20
pkg-manager: pip
21
pypi-cache: false
22
- run:
23
command:
24
pytest businessObjects/test_Login.py
25
26
27
workflows:
28
example-workflow:
29
jobs:
30
- example-job
31
Error is
JavaScript
1
7
1
#!/bin/bash -eo pipefail
2
pytest businessObjects/test_Login.py
3
/bin/bash: pytest: command not found
4
5
Exited with code exit status 127
6
CircleCI received exit code 127
7
It must be some basic mistake but tried a lot and am now stuck. Any help is appreciated. Thanks
Advertisement
Answer
Finally was able to run my code in CircleCI. Posting my config.yml here in case someone else needs help. Thanks, @jortega for trying to help, appreciate your effort.
JavaScript
1
23
23
1
version: 2.1
2
orbs:
3
python: circleci/python@2.0.3
4
jobs:
5
build_and_test: # this can be any name you choose
6
executor: python/default
7
steps:
8
- checkout
9
- python/install-packages:
10
pkg-manager: pip
11
- run:
12
name: Run tests
13
command: python -m pytest
14
- persist_to_workspace:
15
root: ~/project
16
paths: businessObjects
17
- .
18
19
workflows:
20
test_my_app:
21
jobs:
22
- build_and_test
23