Skip to content

Conversation

krishnangovindraj
Copy link
Member

Usage and product changes

Update c driver tests to 3.x and enable deployment

steps:
- run: |
brew install [email protected]
brew install --skip-post-install [email protected] && brew postinstall [email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it fix, again? I think I saw a similar PR, but I don't remember

if (check_error_may_print(__FILE__, __LINE__)) goto cleanup;
options = driver_options_new(false, NULL);;
if (check_error_may_print(__FILE__, __LINE__)) goto cleanup;
TypeDBDriver* driver = driver_open_with_description(address, creds, options, DRIVER_LANG);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we discussed with @flyingsilverfin that we want a separate driver_open function for C, which uses DRIVER_LANG implicitly.

This function should be:

  • Easily preferred by a user compared to driver_open_with_description
  • Easily rejected by a developer of another language (probably with c_lang or something)
  • Ideally, the only function available for the C devs (not possible, driver_open_with_description will always be accessible)

We can rename driver_open_with_description to driver_open_for_swig or something scarier just to be very explicit since we don't really want these descriptions to be compromised. Once done, let's use this function in these tests instead.

if (check_error_may_print(__FILE__, __LINE__)) goto cleanup;
TypeDBDriver* driver = driver_open_with_description(address, creds, options, DRIVER_LANG);
cleanup:
driver_options_drop(options);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it noop if there is nothing to drop?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it will be a good practice to reimplement the README example (generally called example or test_example in unit tests) in C, just like for any other language.

Maybe, when it's done, this test will no longer be needed. Sorry that I didn't think about it when replying to the tests-related messages in Discord.

When we have this example test with comments and stuff, we can implement the copy-to-README mechanism we use in other languages (at least the ones that I've updated myself) to have it in README. It's very simple, you can practice with it or ask me to do so.

Everything can be done using LLMs (give this code as the usage reference and give the Rust or any other example test to rewrite) for the baseline, then iterate to cleanup & fix if needed. As always.

@flyingsilverfin wdyt?

@farost
Copy link
Member

farost commented Oct 10, 2025

When we're done here, we may need to update docs. Keep it in mind, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants