Skip to content

Conversation

saumil-oracle
Copy link
Contributor

Description

Add basic association tests for BelongsTo, HasMany, and ManyToMany.
Tests are run using the below conditions:

=== GORM Environment Information ===
Run at : Wed, 03 Sep 2025 20:35:59 +0530
Go version : go1.24.4 (darwin/arm64)
Oracle Database version : Oracle Database 26ai Enterprise Edition Release 26.0.0.0.0 - Development
Version 26.1.0.24.00
Client Driver : godror : v0.49.0+ODPI-5.6.0
Oracle Client library version : 23.3.0.23.09

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@saumil-oracle saumil-oracle self-assigned this Sep 3, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 3, 2025
}
}

func TestMany2ManyAssociationCountValidation(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test seems a dup of TestMany2ManyAssociation. Could you double check?

Copy link
Contributor Author

@saumil-oracle saumil-oracle Sep 5, 2025

Choose a reason for hiding this comment

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

they are similar, but both the tests have diff purposes:
TestMany2ManyAssociation: it has tests of all many-to-many operations (Find, Append, Replace, Delete, Clear) with basic validation.
TestMany2ManyAssociationCountValidation: I am focusing on validating the accuracy of the Count() method and ensuring it matches the actual Find() results after various operations.

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for the details!

@shelly-li-sl shelly-li-sl merged commit 0166c04 into main Sep 5, 2025
2 checks passed
@shelly-li-sl shelly-li-sl deleted the updateTests branch September 5, 2025 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants