My pipeline is succeeding, but when I try to grab the artifacts, I get the error: "ERROR: No files to upload." I think it must be a problem with the files that are being created are stored in the Dagger pipeline and GitLab cannot access them. Is there an easy way to either mount a directory or export the files so that GitLab can grab them?
async def test():
async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client:
# get reference to the local project
src = client.host().directory(".")
# create a cache volume
pip_cache = client.cache_volume("pip")
poetry_cache = client.cache_volume("poetry")
# ======================== TEST ========================
test_python = (
# use a python 3.8 container because this project is 3.8
client.container().from_("python:3.8-slim-buster")
# load in dependencies cache
.with_mounted_cache("/root/.cache/pip", pip_cache)
.with_mounted_cache("/root/.cache/pypoetry", poetry_cache)
# mount cloned repository into image
.with_mounted_directory("/src", src)
# set current working directory for next commands
.with_workdir("/src")
# install test dependencies
.with_exec(["pip", "install", "poetry"])
.with_exec(["poetry", "install", "--with", "test"])
# run tests
.with_exec(["poetry", "run", "pytest", "--junitxml=test-result.xml", "--cov-report", "xml",
"--cov-report", "term", "--cov=."])
)
# execute
await test_python.exit_code()