Skip to content

Commit 628843e

Browse files
liudmylaruqiuosier
andauthored
Move ADS integration tests to the GitHub repository (#215)
Co-authored-by: Qiu Qin <qiu.qin@oracle.com>
1 parent 91be971 commit 628843e

File tree

77 files changed

+11809
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+11809
-0
lines changed

pytest.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[pytest]
2+
addopts = --verbose -m "not oracledbtest and not cx_Oracle and not thickclient" -p no:warnings --ignore=tests/integration/deprecated
3+
markers =
4+
oracledbtest: tests which require local oracle db access
5+
cx_Oracle: tests which require cx_Oracle to be installed
6+
thickclient: tests with wallet. Has to be called separately to avoid collision with thin client mode

test-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-e .
2+
click
23
coverage
34
faker
45
mock
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"# Import section\n",
10+
"import ads\n"
11+
]
12+
},
13+
{
14+
"cell_type": "markdown",
15+
"metadata": {},
16+
"source": [
17+
"# More Markdown"
18+
]
19+
},
20+
{
21+
"cell_type": "code",
22+
"execution_count": null,
23+
"id": "premier-horror",
24+
"metadata": {},
25+
"outputs": [],
26+
"source": [
27+
"print(ads.__version__)"
28+
]
29+
}
30+
],
31+
"metadata": {
32+
"kernelspec": {
33+
"display_name": "advanced-ds",
34+
"language": "python",
35+
"name": "python3"
36+
},
37+
"language_info": {
38+
"codemirror_mode": {
39+
"name": "ipython",
40+
"version": 3
41+
},
42+
"file_extension": ".py",
43+
"mimetype": "text/x-python",
44+
"name": "python",
45+
"nbconvert_exporter": "python",
46+
"pygments_lexer": "ipython3",
47+
"version": "3.8.13"
48+
},
49+
"vscode": {
50+
"interpreter": {
51+
"hash": "befcbaf13dc629d2a291d651dbccffd20a6370923c026e54da40b794c2f610da"
52+
}
53+
}
54+
},
55+
"nbformat": 4,
56+
"nbformat_minor": 5
57+
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 3,
6+
"id": "ed5cb491",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"data": {
11+
"text/plain": [
12+
"8"
13+
]
14+
},
15+
"execution_count": 3,
16+
"metadata": {},
17+
"output_type": "execute_result"
18+
}
19+
],
20+
"source": [
21+
"a = 1 + 1\n",
22+
"a * 4"
23+
]
24+
},
25+
{
26+
"cell_type": "markdown",
27+
"id": "f1c54fe9",
28+
"metadata": {},
29+
"source": [
30+
"this is markdown\n",
31+
"multiline"
32+
]
33+
},
34+
{
35+
"cell_type": "code",
36+
"execution_count": null,
37+
"id": "84afde0f",
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"print('test')\n",
42+
"print('hello')"
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": null,
48+
"id": "7cb37e67",
49+
"metadata": {
50+
"tags": [
51+
"remove"
52+
]
53+
},
54+
"outputs": [],
55+
"source": [
56+
"print(\"ignore\")"
57+
]
58+
},
59+
{
60+
"cell_type": "code",
61+
"execution_count": null,
62+
"id": "46f7e59e",
63+
"metadata": {},
64+
"outputs": [],
65+
"source": [
66+
"print(\"hello world\")\n",
67+
"print(\"another line\")"
68+
]
69+
},
70+
{
71+
"cell_type": "code",
72+
"execution_count": 4,
73+
"id": "8d980e03",
74+
"metadata": {
75+
"tags": [
76+
"ignore"
77+
]
78+
},
79+
"outputs": [
80+
{
81+
"data": {
82+
"text/plain": [
83+
"'ignore'"
84+
]
85+
},
86+
"execution_count": 4,
87+
"metadata": {},
88+
"output_type": "execute_result"
89+
}
90+
],
91+
"source": [
92+
"c = 4\n",
93+
"\"ignore\""
94+
]
95+
}
96+
],
97+
"metadata": {
98+
"celltoolbar": "Tags",
99+
"interpreter": {
100+
"hash": "befcbaf13dc629d2a291d651dbccffd20a6370923c026e54da40b794c2f610da"
101+
},
102+
"kernelspec": {
103+
"display_name": "Python 3.8.10 64-bit ('advanced-ds': venv)",
104+
"name": "python3"
105+
},
106+
"language_info": {
107+
"codemirror_mode": {
108+
"name": "ipython",
109+
"version": 3
110+
},
111+
"file_extension": ".py",
112+
"mimetype": "text/x-python",
113+
"name": "python",
114+
"nbconvert_exporter": "python",
115+
"pygments_lexer": "ipython3",
116+
"version": "3.8.10"
117+
}
118+
},
119+
"nbformat": 4,
120+
"nbformat_minor": 5
121+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
from my_package import utils
7+
from my_module import my_function_in_module
8+
9+
print("This is the main script.")
10+
my_function_in_module()
11+
utils.my_function_in_package()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
def my_function_in_module():
7+
print("This is a function in a module.")
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
import os
7+
from my_package import utils
8+
from my_module import my_function_in_module
9+
10+
print("This is the entrypoint inside a package.")
11+
my_function_in_module()
12+
utils.my_function_in_package()
13+
print(os.getcwd())
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
import datetime
7+
import os
8+
import sys
9+
print(os.getcwd())
10+
print(sys.path)
11+
12+
import ads
13+
print(ads.__version__)
14+
15+
from my_package import utils
16+
from my_module import my_function_in_module
17+
18+
def write_output():
19+
output_dir = os.environ.get("OUTPUT_DIR", "outputs")
20+
os.makedirs(output_dir, exist_ok=True)
21+
filename = os.path.join(
22+
output_dir,
23+
"python_test.txt"
24+
)
25+
print(f"Writing {os.path.abspath(filename)}...")
26+
with open(filename, "w") as f:
27+
f.write(datetime.datetime.now().strftime("%Y%m%d_%H%M%s.txt"))
28+
29+
print("This is the entrypoint inside a package.")
30+
31+
my_function_in_module()
32+
utils.my_function_in_package()
33+
write_output()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env python
2+
3+
# Copyright (c) 2023 Oracle and/or its affiliates.
4+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
5+
6+
def my_function_in_package():
7+
print("This is a function in a package.")

0 commit comments

Comments
 (0)