xiao
(Xiao Ling)
September 12, 2020, 9:26am
1
I just got below error when running pipeline with the sonarcloud-quality-gate configuration
β Unknown error: unsupported operand type(s) for //: 'str' and 'int'
)
Steps to reproduce (
Pipeline configuration as:
- pipe: sonarsource/sonarcloud-scan:1.1.0
- pipe: sonarsource/sonarcloud-quality-gate:0.1.3
variables:
SONAR_QUALITY_GATE_TIMEOUT: 60
)
Potential workaround: remove the variables
AlxO
(Alex Odoux)
September 15, 2020, 10:01am
2
Hi @xiao ,
Could you specify what is your working environment, especially what ALM you are using?
Thanks,
@AlxO
xiao
(Xiao Ling)
September 15, 2020, 10:21am
3
Hi Alex,
We are using bitbucket pipeline for manage our python code.
The detail configuration of this part in pipeline yaml file is like:
Summary
definitions:
services:
docker:
memory: 2048
steps:
- step: &code-style
name: "Code Style"
script:
- pycodestyle --config .pycodestyle **/**.py
- step: &sonar-scan
image: atlassian/default-image:2
name: "Sonar Scan and Quality Gate"
size: 2x
caches:
- docker
script:
- pipe: sonarsource/sonarcloud-scan:1.1.0
- pipe: sonarsource/sonarcloud-quality-gate:0.1.3
variables:
SONAR_QUALITY_GATE_TIMEOUT: 60
AlxO
(Alex Odoux)
September 15, 2020, 11:49am
4
Hi @xiao ,
This documentation suggest putting the variable between simple quotes, e.g.:
SONAR_QUALITY_GATE_TIMEOUT: '<int>' # Optional
variables:
SONAR_QUALITY_GATE_TIMEOUT: β60β
I donβt know if this correct, but did you try that?
1 Like
xiao
(Xiao Ling)
September 15, 2020, 1:48pm
5
Hi Alex,
I tried both, with and without simple quotes, both got the same error:
β Unknown error: unsupported operand type(s) for //: 'str' and 'int'
janos
(Janos Gyerik)
September 16, 2020, 5:42pm
7
Thank you for reporting this.
I confirm there is a problem, itβs impossible to use the SONAR_QUALITY_GATE_TIMEOUT
variable at the moment. You have no choice but to omit it, and let the pipe use the default timeout (5 minutes).
I created ticket to track this bug: https://jira.sonarsource.com/browse/SCCOMM-44