-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util,build: use
crdb_test
tag instead of metamorphic
This commit switches the builds to become "metamorphic" based on the recently introduced `crdb_test` tag (which is appended to all test targets) instead of `metamorphic`. The corresponding teamcity config is removed because we will get the metamorphic runs with the regular test runs now. Note that since some logic tests cannot be run when some constants initialized to non-default value, in order to not lose the test coverage for those tests, even if `crdb_test` build is specified, with 20% probability the build will not be metamorphic. Additionally, this commit switches the logic of `ConstantWithMetamorphic*` methods to also choose the default value (in 25% cases). The reasoning for this change is that we want to make sure to run the tests with the default values relatively often. To summarize, the current behavior is: - `crdb_test` build tag is specified (all test targets): - with 20% probability the build is not metamorphic, so all magic constants get the default value. - with 80% probability the build is metamorphic. Every value being metamorphized has 75% of being initialized to non-default value. - `crdb_test` build is not specified: - the build is not metamorphic, so all magic constants get the produciton value. Another minor change is a fix to `row.TestingSetDatumRowConverterBatchSize` to properly reset a value to its old one in the returned closure. `TestMysqldumpDataReader` is currently skipped when the metamorphic build occurs pending further investigation. Release note: None
- Loading branch information
1 parent
fd5ca02
commit 62bb08f
Showing
12 changed files
with
92 additions
and
84 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
// +build !crdb_test | ||
|
||
package util | ||
|
||
// crdbTestBuild is a flag that is set to true if the binary was compiled | ||
// with the 'crdb_test' build tag (which is the case for all test targets). This | ||
// flag can be used to enable expensive checks, test randomizations, or other | ||
// metamorphic-style perturbations that will not affect test results but will | ||
// exercise different parts of the code. | ||
const crdbTestBuild = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2020 The Cockroach Authors. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file licenses/BSL.txt. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the Apache License, Version 2.0, included in the file | ||
// licenses/APL.txt. | ||
|
||
// +build crdb_test | ||
|
||
package util | ||
|
||
// crdbTestBuild is a flag that is set to true if the binary was compiled | ||
// with the 'crdb_test' build tag (which is the case for all test targets). This | ||
// flag can be used to enable expensive checks, test randomizations, or other | ||
// metamorphic-style perturbations that will not affect test results but will | ||
// exercise different parts of the code. | ||
const crdbTestBuild = true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.