Skip to content

Conversation

@rpiazza
Copy link
Contributor

@rpiazza rpiazza commented Mar 9, 2025

Can you review this and merge it?

I wasn't creating the integer min/max constraint in the db table

@adulau
Copy link
Contributor

adulau commented Mar 14, 2025

Adding the minand max constraint makes sense. Thanks for the PR.

Not exactly sure why the test is failing.

chisholm and others added 2 commits March 14, 2025 22:01
running the github action.  Also bring workflow actions and
postgres image up to date.
@chisholm
Copy link
Contributor

chisholm commented Mar 25, 2025

On postgres: I do see the check constraints in the table schemas, with the correct limits, so the constraint creation seems to work. Unit tests pass locally, without tox, with the usual unexpected connection drop in the last test (still need to figure that one out). So it works no worse than before. :)

I just tried the sqlite backend for the first time, and the query side failed. It was still trying to qualify table names with schema names. It's not too surprising it didn't work since I don't think the other backends existed when I was writing it. So that will need more work. It probably won't work with Mariadb either.

I don't have permission to merge anything though.

Edit: Oh, stix2/datastore/relational_db and stix2/datastore/relational_db/database_backends still ought to have __init__.pys.

@rpiazza
Copy link
Contributor Author

rpiazza commented Mar 25, 2025

@adulau - Andy and I have been working on a relational database DataStore for Python STIX. I will be doing the merge to the relational-data-sink branch once @chisholm fixes the tests.

I'm not sure if we will be merging the relational-data-sink branch into the master branch at this time

@rpiazza
Copy link
Contributor Author

rpiazza commented Apr 9, 2025

all tests work in sqlite except test_multipart_email_msg...

@chisholm
Copy link
Contributor

Yep, all sqlite tests pass except that one. Only one more to go!

I tried running all sqlite and postgresql tests together, and encountered new errors. I tracked it down to a simple contextmanager cleanup error I made. I fixed it in PR #630 . With that fix, I was able to get a complete run of all relational datastore unit tests so far, to work, except for that one sqlite test with the email message.

Next, getting mariadb to work! :)

@chisholm
Copy link
Contributor

Maybe should continue the discussion here instead of a closed PR:

The some rdb tests still fail not just the email one

When running just the rdb tests, I get:

FAILED stix2/test/v21/test_datastore_relational_db.py::test_multipart_email_msg[sqlite] - AssertionError: assert {'Content-Dis...98.51.100.3']} == {'X-Originati...98.51.100.3']}
===== 1 failed, 371 passed, 108 xfailed, 32 warnings in 117.33s (0:01:57) =====

So it is just the email test for me. When running all unit tests, I get a lot more errors, including a lot with the relational datastore unit tests. That suggests bad interactions with other unit tests. So the obvious thing to try is to fix other unit tests to see if the relational datastore unit test errors will go away.

Were you thinking we should try to fix the other unit tests (or whatever they're testing) too?

chisholm and others added 12 commits April 11, 2025 15:31
Fix test_datastore_add_raises unit tests
Fix test_environment_no_datastore() unit tests
contextmanagers to cleanup registrations after each test.
 - http-request-ext.request_header is supposed to map string to list of
   string
 - error message for DictionaryProperty clean error changed since we
   changed the clean implementation
Fix unit tests in v21/test_custom.py to cleanup after themselves
Fix some v21/test_observed_data.py unit test breakage
@rpiazza rpiazza merged commit 30c6530 into relational-data-sink Apr 24, 2025
11 checks passed
@rpiazza rpiazza deleted the fix-integer-constraint branch April 24, 2025 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants