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

FI-2222: no tests hang fix #425

Merged
merged 18 commits into from
Jan 19, 2024
Merged

FI-2222: no tests hang fix #425

merged 18 commits into from
Jan 19, 2024

Conversation

Shaumik-Ashraf
Copy link
Contributor

@Shaumik-Ashraf Shaumik-Ashraf commented Jan 4, 2024

Summary [Draft PR] (Ready)

Running a test kit with an empty suite or an empty group causes the tests to run indefinitely. An empty test group (or suite) causes a sequel validation error that is raised in the job dispatched from Inferno web server handling POST /inferno/api/test_runs, but subsequent GET /inferno/api/test_runs/... return status: running. Inferno server-side can't seem to handle exceptions raised by jobs outside of the DSL runtime. The recommended fix is to disable the run-test button on the UI, but this won't fix the API or core bug.

This PR bypassed the issue by assigning an omitted result to all empty test groups, which unfreezes the UI and API but doesn't solve the core issue. It also makes the infrastructure test suite break rspec tests since an empty group violates SQL validations. I'm also not sure if adding an empty group to infrastructure test suite is okay. This PR will be a draft until this gets sorted out, and I appreciate any advice!

Testing Guidance

Checkout this branch and run the new empty test group in infrastructure test suite. You can also run rake spec which currently fails.

Comment out lines 126 - 133 in lib/inferno/test_runner.rb to observe the original behavior.

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b7ecc81) 77.06% compared to head (426a071) 77.08%.

Files Patch % Lines
dev_suites/dev_infrastructure_test/empty_group.rb 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
+ Coverage   77.06%   77.08%   +0.02%     
==========================================
  Files         219      220       +1     
  Lines       10931    10945      +14     
  Branches     1026     1028       +2     
==========================================
+ Hits         8424     8437      +13     
- Misses       1928     1929       +1     
  Partials      579      579              
Flag Coverage Δ
backend 93.91% <92.85%> (-0.01%) ⬇️
frontend 69.59% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Shaumik-Ashraf
Copy link
Contributor Author

tagging @Jammjammjamm and @arscan if they have any solutions

@Jammjammjamm
Copy link
Collaborator

Jammjammjamm commented Jan 8, 2024

The issue is that you haven't persisted a test run for that spec. Look at all the other spec groups which create a test run.

@Shaumik-Ashraf Shaumik-Ashraf marked this pull request as ready for review January 8, 2024 16:11
@Shaumik-Ashraf
Copy link
Contributor Author

This PR is ready assuming you accept the solution of marking 'omit' to all empty groups

@@ -434,6 +437,28 @@
end
end
end

describe 'empty_group' do
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is test runner behavior, not test creation behavior, so it should be in the test runner spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I kept the 'contains zero tests' spec in anyways as a negative test, but let me know if I should move this too

@Shaumik-Ashraf Shaumik-Ashraf merged commit 144929d into main Jan 19, 2024
10 checks passed
@Shaumik-Ashraf Shaumik-Ashraf deleted the fi-2222-no-tests-hang-fix branch January 23, 2024 17:37
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.

2 participants