I've set up a pipeline to allow a user to repeat a test a specific number of times. It looks something like this:
image: python:3.11.0
definitions:
caches:
pip3: /usr/local/lib/python3.11/site-packages
steps:
- step: &setup
name: 'Install dependencies'
caches:
- pip3
script:
- python3 -m pip install --upgrade pip
- pip install -r requirements.txt
pipelines:
custom:
run_tests:
- variables:
- name: iterations
default: 1
- step: *setup
- step:
name: 'Run tests'
caches:
- pip3
script:
- |
for i in `seq 1 $iterations`;
do
python run_tests.py
done
artifacts:
- outputs/**
However, PyCharm gives me this error:
Schema validation: Property 'variables' is not allowed
I don't know if the issue is with PyCharm or something else, but there are no problems after the code, and the pipeline runs fine. Anyone know what's causing this?
Hi Danny and welcome to the community!
I see no issues with your bitbucket-pipelines.yml file, the definition of the variables in the custom pipeline looks correct and according to our docs.
I'm not sure why PyCharm shows an error and how they do this validation; it may be best to reach out to the support team of the product if you'd like to get more info on that.
You can use our validator for bitbucket-pipelines.yml if you want to check the validity of your bitbucket-pipelines.yml file:
Kind regards,
Theodora
Thanks for the response. I ran the file through the validator, which shows no problems. I suspect it is a PyCharm issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are welcome Danny, I suspect this may be the case as well.
Please feel free to reach out if you ever need anything else!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.