Skip to content

[Testing:Developer] Explicit fail on cypress unmet condition#12004

Merged
bmcutler merged 1 commit intomainfrom
cypress-wait-fail
Aug 14, 2025
Merged

[Testing:Developer] Explicit fail on cypress unmet condition#12004
bmcutler merged 1 commit intomainfrom
cypress-wait-fail

Conversation

@williamschen23
Copy link
Contributor

Why is this Change Important & Necessary?

DockerUI has been failing rarely now. I cannot debug the issue successfully, but I did notice that there was some discrency in the tests. This is because the dockerui checks the docker status, but that could fail in the previous test. When we use cy.waitAndReloadUntil, we do not really fail if the condition fails to be met. This causes the CI to fail in general.

What is the New Behavior?

This explicitly fails if our condition is never met. Otherwise, the test runs as usual.

What steps should a reviewer take to reproduce or test the bug or new feature?

describe('123', () => {
    it('Test Case', () => {
        cy.login();
        cy.visit('/admin/docker');
        // eslint-disable-next-line no-restricted-syntax
        cy.waitAndReloadUntil(() => {
            return cy.get('[data-testid="docker-status"]')
                .invoke('text')
                .then((text) => {
                    return text.includes('Text does not exist');
                });
        }, 10000, 500);
    });
});

This grabs something that does not exist. Originally the behavior would be that the test passed. With the newbehavior, an error is correctly thrown

Automated Testing & Documentation

Other information

The dockerui might need other work

@codecov
Copy link

codecov bot commented Aug 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 21.66%. Comparing base (199db02) to head (9c291b9).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #12004      +/-   ##
============================================
- Coverage     21.70%   21.66%   -0.04%     
- Complexity     9495     9528      +33     
============================================
  Files           268      268              
  Lines         36298    36398     +100     
  Branches        474      475       +1     
============================================
+ Hits           7878     7886       +8     
- Misses        27950    28041      +91     
- Partials        470      471       +1     
Flag Coverage Δ
autograder 21.31% <ø> (ø)
js 2.07% <ø> (-0.01%) ⬇️
migrator 100.00% <ø> (ø)
php 20.67% <ø> (-0.04%) ⬇️
python_submitty_utils 80.08% <ø> (ø)
submitty_daemon_jobs 90.72% <ø> (ø)

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@jeffrey-cordero jeffrey-cordero left a comment

Choose a reason for hiding this comment

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

Additional error checking within the existing cy.waitAndReloadUntil command looks good.

@github-project-automation github-project-automation bot moved this from Seeking Reviewer to Awaiting Maintainer Review in Submitty Development Aug 14, 2025
@bmcutler bmcutler merged commit 8f4b50c into main Aug 14, 2025
93 of 96 checks passed
@bmcutler bmcutler deleted the cypress-wait-fail branch August 14, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants