Skip to content

Commit

Permalink
test: testing
Browse files Browse the repository at this point in the history
  • Loading branch information
jesrypandawa committed Jun 9, 2022
1 parent b65a191 commit d05b55e
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 6 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/python_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ jobs:
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Zip Python Udf
run: |
zip -r python_udfs.zip python-functions/udfs -x "*/__init__.py"
zip -r python_functions_${{ env.RELEASE_VERSION }}.zip python-functions/requirements.txt python-functions/data python_udfs.zip
zip -r python_udfs.zip dagger-py-functions/udfs -x "*/__init__.py"
zip -r data.zip dagger-py-functions/data
zip -r dagger-py-functions.zip dagger-py-functions/requirements.txt data.zip python_udfs.zip
- name: Upload Release
uses: ncipollo/release-action@v1
with:
artifacts: python_functions_${{ env.RELEASE_VERSION }}.zip
artifacts: dagger-py-functions.zip
allowUpdates: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
Expand Down
1 change: 1 addition & 0 deletions dagger-py-functions/data/test_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
added_text
1 change: 1 addition & 0 deletions dagger-py-functions/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest==7.1.2
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions dagger-py-functions/tests/udfs/scalar/sample_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from udfs.scalar.sample import sample


def testSample():
f = sample._func
assert f("input_text") == "input_text_added_text"

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

@udf(result_type=DataTypes.STRING())
def sample(text):
return text + "_added_text"
file = open("data/test_file.txt", "r")
data = file.read()
return text + '_' + data
2 changes: 0 additions & 2 deletions python-functions/requirements.txt

This file was deleted.

0 comments on commit d05b55e

Please sign in to comment.