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

Ensure git tag tests and others create test repos in tmpdir #18447

Merged
merged 4 commits into from
Jan 29, 2022

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jan 29, 2022

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Also ensure that integration tests go to repo_test_dir too.

Fix #18444
Fix #18077

Signed-off-by: Andrew Thornton art27@cantab.net

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix go-gitea#18444

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added type/testing skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Jan 29, 2022
@zeripath zeripath added this to the 1.17.0 milestone Jan 29, 2022
@zeripath zeripath changed the title Ensure git tag tests and other create test repos in tmpdir Ensure git tag tests and others create test repos in tmpdir Jan 29, 2022
Signed-off-by: Andrew Thornton <art27@cantab.net>
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 29, 2022
Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

LGTM. IIRC, most assert.Xxx return bool

if err != nil {
	assert.NotNil(t, aTag)
	return
}

could be written as:

if !assert.NotNil(t, aTag) {
	return
}

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix go-gitea#18077

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath mentioned this pull request Jan 29, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #18447 (21eb803) into main (92b715e) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18447   +/-   ##
=======================================
  Coverage   46.01%   46.02%           
=======================================
  Files         842      842           
  Lines       93192    93192           
=======================================
+ Hits        42881    42887    +6     
+ Misses      43508    43500    -8     
- Partials     6803     6805    +2     
Impacted Files Coverage Δ
modules/process/manager.go 81.39% <0.00%> (-1.56%) ⬇️
modules/queue/queue_disk_channel.go 62.87% <0.00%> (-1.49%) ⬇️
routers/api/v1/repo/pull.go 28.35% <0.00%> (-0.51%) ⬇️
modules/queue/workerpool.go 56.87% <0.00%> (ø)
modules/queue/queue_channel.go 85.10% <0.00%> (+2.12%) ⬆️
modules/queue/queue_bytefifo.go 54.95% <0.00%> (+5.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92b715e...21eb803. Read the comment docs.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 29, 2022
@zeripath zeripath merged commit f7b152f into go-gitea:main Jan 29, 2022
@zeripath zeripath deleted the fix-18444-no-more-annotated-failures branch January 29, 2022 12:41
zeripath added a commit to zeripath/gitea that referenced this pull request Feb 14, 2022
…#18447)

Backport go-gitea#18447

* Ensure git tag tests and other create test repos in tmpdir

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix go-gitea#18444

* Change log root for integration tests to use the REPO_TEST_DIR

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix go-gitea#18077

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added backport/done All backports for this PR have been created backport/v1.16 labels Feb 14, 2022
lunny pushed a commit that referenced this pull request Feb 15, 2022
…18767)

Backport #18447

* Ensure git tag tests and other create test repos in tmpdir

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix #18444

* Change log root for integration tests to use the REPO_TEST_DIR

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix #18077

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
…#18447)

* Ensure git tag tests and other create test repos in tmpdir

There are a few places where tests appear to reuse testing repos which
causes random CI failures.

This PR simply changes these tests to ensure that cloning always happens
into new temporary directories.

Fix go-gitea#18444

* Change log root for integration tests to use the REPO_TEST_DIR

There is a potential race in the drone integration tests whereby test-mysql etc
will start writing to log files causing make test-check fail.

Fix go-gitea#18077

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Random unit test failure in TestRepository_GetAnnotatedTag CI unrelated failures
6 participants