Skip to content

Feature implementation from commits 11522a0..0ff4bb4#2

Open
yashuatla wants to merge 15 commits into
feature-base-2from
feature-head-2
Open

Feature implementation from commits 11522a0..0ff4bb4#2
yashuatla wants to merge 15 commits into
feature-base-2from
feature-head-2

Conversation

@yashuatla
Copy link
Copy Markdown
Owner

This PR contains changes from a range of commits from the original repository.

Commit Range: 11522a0..0ff4bb4
Files Changed: 12 (12 programming files)
Programming Ratio: 100.0%

Commits included:

dolmen and others added 15 commits May 23, 2025 16:17
Enable parallel testing for almost all tests in packages 'assert' and
'require' by calling t.Parallel() as the first line of the test.

A few tests are incompatible and will be fixed separately. They are
marked with a FIXME.
Incompatible tests: TestFileExists, TestNoFileExists, TestDirExists,
TestNoDirExists.

Before:
  $ go test -count=10 ./assert ./require
  ok  	github.com/stretchr/testify/assert	7.575s
  ok  	github.com/stretchr/testify/require	1.501s

After:
  $ go test -count=10 ./assert ./require
  ok  	github.com/stretchr/testify/assert	1.703s
  ok  	github.com/stretchr/testify/require	1.245s
…enable-parallel-testing

assert,require: enable parallel testing on (almost) all top tests
## Summary
This test case verifies that the Passed method returns false when all
tests in the suite fail

## Changes
Added a test case to check the scenario where all tests fail.

## Motivation
This test is important to ensure that the Passed method correctly
identifies the overall failure state of a test suite when none of the
individual tests pass.

 ## Example usage 
This test can be used as a part of the test suite to validate the
behavior of the Passed method under failure conditions.

## Related issues
None
Add an Helper() method to all mocks in tests of package 'assert'.
Add Helper() method to CollectT like testing.T as we intend to add
Helper() to the assert.TestingT interface.
…ests

Add Helper() method in internal mocks and assert.CollectT
Co-authored-by: Olivier Mengué <dolmen@cpan.org>
Shortcut in assert.JSONEq once we have validated that 'expected' is
valid JSON, and 'actual' is the exact same string.
Shortcut in assert.YAMLEq once we have validated that 'expected' is
valid YAML, and 'actual' is the exact same string.
Add t.Parallel() to all package-level tests of the 'mock' package.
Result: faster tests results.

Before:
  $ go test -count=10 ./mock
  ok  	github.com/stretchr/testify/mock	0.631s
After:
  $ go test -count=10 ./mock
  ok  	github.com/stretchr/testify/mock	0.426s
…esting

mock: enable parallel testing on internal testsuite
Cleanup runtime use of stdlib's testing internals which was required for older
Go versions.

Note: we are still using testing.RunTests in the suite's test suite for
now.
…f-testing-internals

suite: cleanup use of 'testing' internals at runtime
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.

5 participants