-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acceptance test for 'experimental.scripts' (#2240)
- Loading branch information
Showing
6 changed files
with
78 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
bundle: | ||
name: scripts | ||
|
||
experimental: | ||
scripts: | ||
preinit: "python3 ./myscript.py $EXITCODE preinit" | ||
postinit: "python3 ./myscript.py 0 postinit" | ||
prebuild: "python3 ./myscript.py 0 prebuild" | ||
postbuild: "python3 ./myscript.py 0 postbuild" | ||
predeploy: "python3 ./myscript.py 0 predeploy" | ||
postdeploy: "python3 ./myscript.py 0 postdeploy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import sys | ||
|
||
info = " ".join(sys.argv[1:]) | ||
sys.stderr.write(f"from myscript.py {info}: hello stderr!\n") | ||
sys.stdout.write(f"from myscript.py {info}: hello stdout!\n") | ||
|
||
exitcode = int(sys.argv[1]) | ||
sys.exit(exitcode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
>>> EXITCODE=0 errcode $CLI bundle validate | ||
Executing 'preinit' script | ||
from myscript.py 0 preinit: hello stdout! | ||
from myscript.py 0 preinit: hello stderr! | ||
Executing 'postinit' script | ||
from myscript.py 0 postinit: hello stdout! | ||
from myscript.py 0 postinit: hello stderr! | ||
Name: scripts | ||
Target: default | ||
Workspace: | ||
User: $USERNAME | ||
Path: /Workspace/Users/$USERNAME/.bundle/scripts/default | ||
|
||
Validation OK! | ||
|
||
>>> EXITCODE=1 errcode $CLI bundle validate | ||
Executing 'preinit' script | ||
from myscript.py 1 preinit: hello stdout! | ||
from myscript.py 1 preinit: hello stderr! | ||
Error: failed to execute script: exit status 1 | ||
|
||
Name: scripts | ||
|
||
Found 1 error | ||
|
||
Exit code: 1 | ||
|
||
>>> EXITCODE=0 errcode $CLI bundle deploy | ||
Executing 'preinit' script | ||
from myscript.py 0 preinit: hello stdout! | ||
from myscript.py 0 preinit: hello stderr! | ||
Executing 'postinit' script | ||
from myscript.py 0 postinit: hello stdout! | ||
from myscript.py 0 postinit: hello stderr! | ||
Executing 'prebuild' script | ||
from myscript.py 0 prebuild: hello stdout! | ||
from myscript.py 0 prebuild: hello stderr! | ||
Executing 'postbuild' script | ||
from myscript.py 0 postbuild: hello stdout! | ||
from myscript.py 0 postbuild: hello stderr! | ||
Executing 'predeploy' script | ||
from myscript.py 0 predeploy: hello stdout! | ||
from myscript.py 0 predeploy: hello stderr! | ||
Error: unable to deploy to /Workspace/Users/$USERNAME/.bundle/scripts/default/state as $USERNAME. | ||
Please make sure the current user or one of their groups is listed under the permissions of this bundle. | ||
For assistance, contact the owners of this project. | ||
They may need to redeploy the bundle to apply the new permissions. | ||
Please refer to https://docs.databricks.com/dev-tools/bundles/permissions.html for more on managing permissions. | ||
|
||
|
||
Exit code: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
trace EXITCODE=0 errcode $CLI bundle validate | ||
trace EXITCODE=1 errcode $CLI bundle validate | ||
trace EXITCODE=0 errcode $CLI bundle deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.