Skip to content

Commit

Permalink
test(digitalhub): aligned tests for the 0.9 version with Argo Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcagiara committed Dec 5, 2024
1 parent 7be1d52 commit 9a437b0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
9 changes: 7 additions & 2 deletions charts/digitalhub/confs/tests/python-test/s1-etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ def main():
os.environ["DHCORE_ACCESS_TOKEN"] = token["access_token"]

# Load project
proj = dh.import_project("project-etl-ci.yml")
try:
proj = dh.import_project("projects-project-etl.yaml")
except:
proj = dh.load_project("projects-project-etl.yaml")

URL = "https://opendata.comune.bologna.it/api/explore/v2.1/catalog/datasets/rilevazione-flusso-veicoli-tramite-spire-anno-2023/exports/csv?lang=it&timezone=Europe%2FRome&use_labels=true&delimiter=%3B"
di= proj.new_dataitem(name="url_data_item",kind="table",path=URL)
workflow_run = proj.run('pipeline', parameters={"url": di.key})

proj.run('pipeline', action="build")
workflow_run = proj.run('pipeline', action="pipeline", parameters={"url": di.key})

# Wait for run to finish
poller(workflow_run)
Expand Down
9 changes: 7 additions & 2 deletions charts/digitalhub/confs/tests/python-test/s2-dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ def main():
os.environ["DHCORE_ACCESS_TOKEN"] = token["access_token"]

# Load project
proj = dh.import_project("project-dbt-ci.yml")
try:
proj = dh.import_project("projects-project-dbt-ci.yaml")
except:
proj = dh.load_project("projects-project-dbt-ci.yaml")

url = "https://gist.githubusercontent.com/kevin336/acbb2271e66c10a5b73aacf82ca82784/raw/e38afe62e088394d61ed30884dd50a6826eee0a8/employees.csv"
di_url = proj.new_dataitem(name="url_data_item",kind="table",path=url)
workflow_run = proj.run('pipeline_dbt', parameters={"url": di_url.key})

proj.run('pipeline_dbt', action="build")
workflow_run = proj.run('pipeline_dbt', action="pipeline", parameters={"di": di_url.key})

# Wait for run to finish
poller(workflow_run)
Expand Down
8 changes: 6 additions & 2 deletions charts/digitalhub/confs/tests/python-test/s3-scikit-learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ def main():
os.environ["DHCORE_ACCESS_TOKEN"] = token["access_token"]

# Load project
proj = dh.import_project("project-ml-ci.yml")
try:
proj = dh.import_project("projects-project-ml-ci.yaml")
except:
proj = dh.load_project("projects-project-ml-ci.yaml")

workflow_run = proj.run('pipeline_ml')
proj.run('pipeline_ml', action="build")
workflow_run = proj.run('pipeline_ml', action="pipeline")

# Wait for run to finish
poller(workflow_run)
Expand Down
7 changes: 6 additions & 1 deletion charts/digitalhub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ false
Set packages versions for tests
*/}}
{{- define "digitalhub.testPackages" -}}
{{- $command := "pip install --cache-dir home/pipcache" -}}
{{- $command := "" -}}
{{- if .Values.platformTests.preRelease -}}
{{- $command = "pip install --pre --cache-dir home/pipcache" -}}
{{- else -}}
{{- $command = "pip install --cache-dir home/pipcache" -}}
{{- end -}}
{{- range $package := .Values.platformTests.packages -}}
{{- $command = printf "%s %s" $command $package.name }}
{{- if $package.tag -}}
Expand Down

0 comments on commit 9a437b0

Please sign in to comment.