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

hatch logs misrepresent as errors in azure devops pipeline #1888

Open
JohnStokes228 opened this issue Jan 15, 2025 · 1 comment
Open

hatch logs misrepresent as errors in azure devops pipeline #1888

JohnStokes228 opened this issue Jan 15, 2025 · 1 comment

Comments

@JohnStokes228
Copy link

I am using hatch in an azure devops yaml pipeline task:

pip install uv
uv pip install hatch

if [[ $BUILDSOURCEBRANCH == refs/pull/* || $BUILDREASON == "PullRequest" ]]; then
    hatch test --all --cov --cov-report=xml --cov-report=term --randomize --junitxml=junit/test-results.xml
else
    hatch test --cov --cov-report=xml --cov-report=term --randomize --junitxml=junit/test-results.xml
fi

this runs my tests and produces my coverage report fine, however azure devops is reading the trace of the environment build logs as if they were errors and thus creating a breaking failure for the pipeline run itself:


##[error]Checking dependencies
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Checking dependencies

##[error]Syncing dependencies
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Syncing dependencies

##[error]Creating environment: hatch-test.py3.9
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Creating environment: hatch-test.py3.9

##[error]Installing project in development mode
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Installing project in development mode

##[error]Checking dependencies
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Checking dependencies

##[error]Syncing dependencies
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Syncing dependencies

##[error]Resolved 47 packages in 1.72s
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Resolved 47 packages in 1.72s

##[error]Prepared 28 packages in 590ms
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Prepared 28 packages in 590ms

##[error]Installed 46 packages in 51ms
##[debug]Processed: ##vso[task.issue type=error;source=CustomerScript;correlationId=203bb983-3b93-4736-a572-2a145cfca3a1;]Installed 46 packages in 51ms

##[error] + anyio==4.8.0
 + backports-tarfile==1.2.0
 + certifi==2024.12.14
 + cffi==1.17.1
 + click==8.1.8
...

this trace continues down the log trace with every error it raises also being processed as a debug statement first. notably, once it starts erroring on seemingly random package installs in the downloaded packages list, somethign a bit odd in the pattern becomes visible in that its not individual lines of the trace erroring but in some cases it appears to be susbets of individual lines:

 + httpx==
##[error]0.28.1

...

 +
##[error] pluggy==1.5.0
... etc

Is it possible to understand why the logs are behaving in this way? it is quite specifically the environment build logs, however using uv natively doesnt cause the same issue at all. Is there any tool or cmd option available that will suppress these logs if needs be? I have tried the --quiet command but it doesnt seem to work to stifle them.

cheers,

John

@JohnStokes228
Copy link
Author

to update on this - even throwing the whole stderr and stdout into dev/null still leaves some logs (including some that raise errors) remaining. why is some of the log trace writing to a third destination? this doesnt feel constructive to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant