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

Package tests (as run by make test-sqlite) do not clean up after themselves #21020

Closed
zeripath opened this issue Sep 1, 2022 · 1 comment · Fixed by #22984
Closed

Package tests (as run by make test-sqlite) do not clean up after themselves #21020

zeripath opened this issue Sep 1, 2022 · 1 comment · Fixed by #22984

Comments

@zeripath
Copy link
Contributor

zeripath commented Sep 1, 2022

Description

The package tests are not correctly cleaning up after running leading to incorrect reports of errors if make test-sqlite is run again.

--- FAIL: TestPackagePub (0.15s)
    testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-36] router: completed GET /user/settings/applications for , 200 OK in 1.8ms @ setting/applications.go:24(setting.Applications)
    testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-37] router: completed POST /user/settings/applications for , 303 See Other in 18.9ms @ setting/applications.go:34(setting.ApplicationsPost)
    testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-38] router: completed GET /user/settings/applications for , 200 OK in 1.9ms @ setting/applications.go:24(setting.Applications)
    --- FAIL: TestPackagePub/Upload (0.06s)
        testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-39] router: completed GET /api/packages/user2/pub/api/packages/versions/new for , 401 Unauthorized in 0.2ms @ packages/api.go:34(packages.reqPackageAccess)
        testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-40] router: completed GET /api/packages/user2/pub/api/packages/versions/new for , 200 OK in 16.7ms @ pub/pub.go:147(pub.RequestUpload)
        testlogger.go:78: 2022/09/01 17:50:40 ...packages/packages.go:161:createPackageAndVersion() [E] [6310e2e0-41] Error inserting package: Package version already exists
        testlogger.go:78: 2022/09/01 17:50:40 ...eb/routing/logger.go:99:func1() [I] [6310e2e0-41] router: completed POST http://localhost:3003/api/packages/user2/pub/api/packages/versions/new/upload for , 400 Bad Request in 16.0ms @ pub/pub.go:160(pub.UploadPackageFile)
        api_packages_pub_test.go:92: 
            	Error Trace:	/home/andrew/src/go/gitea/integration_test.go:506
            	            				/home/andrew/src/go/gitea/api_packages_pub_test.go:92
            	            				/home/andrew/src/go/gitea/api_packages_pub_test.go:95
            	Error:      	Not equal: 
            	            	expected: 204
            	            	actual  : 400
            	Test:       	TestPackagePub/Upload
            	Messages:   	Request: POST http://localhost:3003/api/packages/user2/pub/api/packages/versions/new/upload
        api_packages_pub_test.go:92: Response: {"error":{"code":"Bad Request","message":"Package version already exists"}}

Gitea Version

d74390e (if not earlier)

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

make test-sqlite

Database

No response

@KN4CK3R
Copy link
Member

KN4CK3R commented Sep 6, 2022

Are the integration tests intended to run multiple times without cleaning the used directory? I use rm -R -f integrations/gitea-integration-sqlite/ && make test-sqlite to run the tests.

lunny added a commit that referenced this issue Feb 23, 2023
Fixes #21020

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants