Skip to content

Commit ce1ba1d

Browse files
committed
Enhance P3 implementation and remove NuoDB Agent support
Since NuoDB 4.2 we no longer support NuoDB Agent and only support nuoadmin for our administration layer. Remove the integration with NuoDB Agent from the pynuodb module. Additionally a lot of other work was done: Add support for direct NuoDB TE connections, using the 'direct' connection parameter. Add mypy and pylint checking. Provide Makefile targets to run Mypy and Pylint on the codebase. Provide a pylintrc file. Improve the code to satisfy these checkers. Since we still support Python2, we use the comment-based type: decorators instead of Python 3 inline type definitions for mypy. We could switch to .pyi files but I didn't do that. Enhance the exceptions to more closely align with PEP 249, and add proper docstrings. Document the BatchError and EndOfStream special exceptions. Add PEP 249 standard Connection.autocommit and setautocommit() and deprecate the non-standard auto_commit. Also support an 'autocommit' argument to the connect() method. Align the types of elements and clean up the Python 3 support. We do this by settling on using the bytearray type for message creation and storage on both P2 and P3, rather than converting to/from latin-1 etc. I wanted to use bytes which would be a better fit for at least received messages, but this is difficult in Python2 because str and bytes are essentially the same type which means we'd need to do a lot of special handling if we were running P2. Most of the P2 vs. P3 differences are encapsulated in the crypto library, where we have methods to convert from bytes to a bytearray and from a bytearray to a str. Using bytearray allows the implementations of methods like toByteString and fromByteString to be the same between P2 and P3. Modify the datatype.Binary object to inherit from bytes. For backward- compatibility, preserve the string data member and __str__(). Use integer comparison for encodedsession rather than range(), and make more use of protocol values and less of magic numbers. Create some simplifying helper methods. Keep latin-1 encoding when we want to treat strings as lists of bytes, but choose utf-8 encoding for XML etc. Modify tests to be more correct, and add a test of Session.authorize() and performing Engine requests.
1 parent 059b731 commit ce1ba1d

27 files changed

+2379
-3175
lines changed

.circleci/config.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,37 @@ commands:
99
- run:
1010
name: On failure action
1111
command: |
12-
cat /var/log/nuodb/nuoadmin.log*
13-
grep ssl /opt/nuodb/etc/nuoadmin.conf
12+
env | sort
13+
echo ------
14+
cat $HOME/.bashrc $HOME/.profile $HOME/.bash_profile || true
15+
echo ------
16+
cat $HOME/.nuocmdrc || true
17+
echo ------
18+
cat /var/log/nuodb/nuoadmin.log* || true
19+
echo ------
20+
cat /tmp/nuotest.log || true
21+
echo ------
22+
grep ssl /etc/nuodb/nuoadmin.conf || true
1423
when: <<parameters.when>>
1524

1625
- when:
1726
condition: <<parameters.when>>
1827
steps:
1928
- store_artifacts:
2029
path: /var/log/nuodb/nuoadmin.log
21-
2230

2331
jobs:
2432
build_n_run:
2533
docker:
2634
- image: nuodb/nuodb-ce:latest
2735
user: root
2836
resource_class: small
37+
environment:
38+
TZ : America/New_York
39+
NUO_SET_TLS : disable
40+
NUOCMD_CLIENT_KEY : ""
41+
NUOCMD_VERIFY_SERVER : ""
42+
NUOCMD_PLUGINS : ""
2943
steps:
3044
- checkout
3145
- run:
@@ -41,22 +55,19 @@ jobs:
4155
name : Configure and run NuoDB Admin
4256
command: |
4357
sudo -u nuodb "/opt/nuodb/etc/nuoadmin" tls $NUO_SET_TLS
58+
sudo -u nuodb "/opt/nuodb/etc/nuoadmin" tls status
4459
sudo -u nuodb "/opt/nuodb/etc/nuoadmin" start
4560
- run:
4661
name: Run test
47-
command: make test
62+
command: make fulltest "PYTEST_ARGS=--log-file-level=10 --log-file=/tmp/nuotest.log"
4863
- store_artifacts:
4964
path: htmlcov
5065
- store_test_results:
5166
path: test_results
5267
- after_failure:
5368
when : "on_fail"
5469

55-
environment:
56-
TZ : America/New_York
57-
NUO_SET_TLS : disable
58-
5970
workflows:
6071
build-project:
6172
jobs:
62-
- build_n_run
73+
- build_n_run

0 commit comments

Comments
 (0)