-
Notifications
You must be signed in to change notification settings - Fork 2.8k
chore(ci): move integration tests to GitHub Actions #485
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
Conversation
| case tc.expectedError != "": | ||
| require.NotNil(t, err) | ||
| assert.Contains(t, err.Error(), tc.expectedError, tc.name) | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in this case, an error is expected. It means we don't have to compare want and got. The original code is the following.
switch {
case tc.expectedError != "":
require.NotNil(t, err)
assert.Contains(t, err.Error(), tc.expectedError, tc.name
default:
...
}
if !tc.invalidImage {
// compare want and got
...
}
So, I've changed it to the following
switch {
case tc.expectedError != "":
require.NotNil(t, err)
assert.Contains(t, err.Error(), tc.expectedError, tc.name
return
default:
...
}
// compare want and got
compare()
I prefer a shallow nest.
* fix(standalone): add defer to close databases * test(client/server): launch a server only once * test(docker_engine): remove the duplicated case * test(docker_engine): copy a database only once * test(standalone): copy a database only once * test(server): fix tests according to updated mock * chore(mod): update * chore(ci): add integration tests to GitHub Actions * chore(ci): bump up Go to 1.14 * chore(ci): remove integration tests from CircleCI * chore(ci): add name * chore(ci): add new lines
* fix(standalone): add defer to close databases * test(client/server): launch a server only once * test(docker_engine): remove the duplicated case * test(docker_engine): copy a database only once * test(standalone): copy a database only once * test(server): fix tests according to updated mock * chore(mod): update * chore(ci): add integration tests to GitHub Actions * chore(ci): bump up Go to 1.14 * chore(ci): remove integration tests from CircleCI * chore(ci): add name * chore(ci): add new lines
* fix(standalone): add defer to close databases * test(client/server): launch a server only once * test(docker_engine): remove the duplicated case * test(docker_engine): copy a database only once * test(standalone): copy a database only once * test(server): fix tests according to updated mock * chore(mod): update * chore(ci): add integration tests to GitHub Actions * chore(ci): bump up Go to 1.14 * chore(ci): remove integration tests from CircleCI * chore(ci): add name * chore(ci): add new lines
…init' (aquasecurity#485) Signed-off-by: Liam Galvin <liam.galvin@aquasec.com>
Overview
gunzipDBcopies a database file to the temporal directory every time. It consumes a lot of disk spaces even if the file is removed bydefer os.RemoveAll(cacheDir). This is because the test process is still running, so the removed file can't be seen, but exists until the test process finishes.ref. https://access.redhat.com/solutions/2316
After all, it reaches the capacity of disk and returns the error "no space left on device". This PR changed tests so that the database file can be copied only once.
Blocker
go get -uafter feat(cache): add close function fanal#104 is merged