Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fetch documents on test execution start #1163

Merged
merged 1 commit into from
Mar 7, 2023

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #1162

Description

The schema updates PR exposed a bug in the new integration test framework where documents created in the setup phase (using the target branch code) were not available using the execution phase (using the current/test branch), resulting in index out of bounds exceptions when trying to reference them.

Bug was previously not visible as the Schema Updates tests were the first to split Create and Update document actions on either side of the change detector.

This PR fetches documents created in the setup phase at the start of the execution phase, allowing them to be referenced correctly.

@AndrewSisley AndrewSisley added bug Something isn't working area/testing Related to any test or testing suite action/no-benchmark Skips the action that runs the benchmark. labels Mar 7, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.5 milestone Mar 7, 2023
@AndrewSisley AndrewSisley requested a review from a team March 7, 2023 20:40
@AndrewSisley AndrewSisley self-assigned this Mar 7, 2023
@AndrewSisley AndrewSisley changed the title Fetch documents on test execution start test: Fetch documents on test execution start Mar 7, 2023
The document set needs to include documents created in the startup actions - in the case of the change detector, this may be done in another process and so they must be fetched in the correct order from the database.
@codecov
Copy link

codecov bot commented Mar 7, 2023

Codecov Report

Merging #1163 (2fc91b5) into develop (799a242) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1163      +/-   ##
===========================================
- Coverage    68.30%   68.28%   -0.02%     
===========================================
  Files          181      181              
  Lines        17007    17007              
===========================================
- Hits         11616    11613       -3     
- Misses        4424     4426       +2     
- Partials       967      968       +1     
Impacted Files Coverage Δ
datastore/badger/v3/datastore.go 38.63% <0.00%> (-0.49%) ⬇️

Copy link
Contributor

@orpheuslummis orpheuslummis left a comment

Choose a reason for hiding this comment

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

LGTM

@AndrewSisley AndrewSisley merged commit e5a81c1 into develop Mar 7, 2023
@AndrewSisley AndrewSisley deleted the sisley/test/I1162-change-detector-split branch March 7, 2023 23:47
shahzadlone pushed a commit that referenced this pull request Apr 13, 2023
The document set needs to include documents created in the startup actions - in the case of the change detector, this may be done in another process and so they must be fetched in the correct order from the database.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
The document set needs to include documents created in the startup actions - in the case of the change detector, this may be done in another process and so they must be fetched in the correct order from the database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/testing Related to any test or testing suite bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change detector bug when splitting between Create/Update actions
2 participants