Skip to content

Commit cbbfd48

Browse files
Remove optimistic unit tests (Synthetixio#1160)
* Remove useOvm from test task * Remove useOvm from test task * Remove @ovm-skip marker * Removed ovm unit tests from CI * Remove npm test:ovm task
1 parent 83897e4 commit cbbfd48

File tree

80 files changed

+78
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+78
-143
lines changed

.circleci/config.yml

-24
Original file line numberDiff line numberDiff line change
@@ -260,27 +260,6 @@ jobs:
260260
- run: npm run test:gas
261261
- store_artifacts:
262262
path: test-gas-used.log
263-
job-unit-tests-ovm:
264-
working_directory: ~/repo
265-
docker:
266-
- image: synthetixio/docker-node:14.16-focal
267-
auth:
268-
username: $DOCKERHUB_USERNAME
269-
password: $DOCKERHUB_TOKEN
270-
steps:
271-
- checkout
272-
- attach_workspace:
273-
at: .
274-
- run: npx hardhat compile --showsize --optimizer --force --use-ovm
275-
- run:
276-
name: Test and output gas used
277-
command: |
278-
set +e
279-
npm run test:ovm -- --no-compile
280-
EXIT_CODE=$?
281-
cat test-gas-used.log
282-
printf "\\n"
283-
exit $EXIT_CODE
284263
job-unit-tests:
285264
working_directory: ~/repo
286265
docker:
@@ -346,9 +325,6 @@ workflows:
346325
- job-unit-tests:
347326
requires:
348327
- job-prepare
349-
- job-unit-tests-ovm:
350-
requires:
351-
- job-prepare
352328
- job-unit-tests-coverage:
353329
requires:
354330
- job-prepare

.circleci/src/jobs/job-unit-tests-ovm.yml

-16
This file was deleted.

.circleci/src/workflows/workflow-all.yml

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1616
- job-unit-tests:
1717
{{> require-prepare.yml}}
18-
- job-unit-tests-ovm:
19-
{{> require-prepare.yml}}
2018
- job-unit-tests-coverage:
2119
{{> require-prepare.yml}}
2220
- job-unit-tests-gas-report:

hardhat/tasks/task-test.js

+3-25
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,14 @@ const optimizeIfRequired = require('../util/optimizeIfRequired');
55
task('test')
66
.addFlag('optimizer', 'Compile with the optimizer')
77
.addFlag('gas', 'Compile gas usage')
8-
.addFlag('useOvm', 'Run tests on the OVM using a custom OVM provider')
98
.addFlag('native', 'Compile with the native solc compiler')
109
.addOptionalParam('gasOutputFile', 'Gas reporter output file')
1110
.addOptionalParam('grep', 'Filter tests to only those with given logic')
1211
.setAction(async (taskArguments, hre, runSuper) => {
13-
const { gas, grep, useOvm, native, gasOutputFile, noCompile } = taskArguments;
12+
const { gas, grep, native, gasOutputFile } = taskArguments;
1413

15-
if (useOvm) {
16-
if (!noCompile) {
17-
await hre.run('compile', { useOvm });
18-
}
19-
20-
if (!hre.config.prod) {
21-
hre.ovm = true;
22-
}
23-
24-
console.log(gray('Running tests in the OVM...'));
25-
require('@eth-optimism/plugins/hardhat/compiler');
26-
require('@eth-optimism/plugins/hardhat/web3');
27-
28-
if (!grep) {
29-
console.log(gray(`Ignoring test specs containing`, yellow('@ovm-skip')));
30-
hre.config.mocha.grep = '@ovm-skip';
31-
hre.config.mocha.invert = true;
32-
}
33-
hre.config.mocha.timeout = 3600e3; // 1hr timeout for ovm
34-
} else {
35-
// apply a 90s timeout unless already set (for coverage say)
36-
hre.config.mocha.timeout = hre.config.mocha.timeout || 90e3;
37-
}
14+
// apply a 90s timeout unless already set (for coverage say)
15+
hre.config.mocha.timeout = hre.config.mocha.timeout || 90e3;
3816

3917
if (native) {
4018
hre.config.solc.native = true;

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"test": "hardhat test",
2020
"describe": "hardhat describe",
2121
"test:gas": "hardhat test --gas --optimizer || cat test-gas-used.log",
22-
"test:ovm": "hardhat test --use-ovm --optimizer",
2322
"test:prod": "hardhat test:prod --network localhost --optimizer",
2423
"test:prod:gas": "hardhat test:prod --gas --network localhost --optimizer --gas-output-file test-gas-used-prod.log",
2524
"test:prod:ovm": "concurrently --kill-others --success first \"wait-port 8545 && wait-port 9545 && mocha test/optimism --timeout 900000\"",

test/contracts/AddressResolver.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { mockGenericContractFnc, setupAllContracts } = require('./setup');
1313

1414
const AddressResolver = artifacts.require('AddressResolver');
1515

16-
contract('AddressResolver @ovm-skip', accounts => {
16+
contract('AddressResolver', accounts => {
1717
const [deployerAccount, owner, account1, account2, account3, account4] = accounts;
1818

1919
let resolver;

test/contracts/AddressSetLib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const { contract, artifacts } = require('hardhat');
22
const { assert, addSnapshotBeforeRestoreAfterEach } = require('./common');
33
const TestableAddressSet = artifacts.require('TestableAddressSet');
44

5-
contract('AddressSetLib @ovm-skip', accounts => {
5+
contract('AddressSetLib', accounts => {
66
let set;
77

88
const [a, b, c, d, e] = accounts;

test/contracts/BaseRewardEscrowV2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const BN = require('bn.js');
1919
const ethers = require('ethers');
2020
const { parseEther } = ethers.utils;
2121

22-
contract('BaseRewardEscrowV2 @ovm-skip', async accounts => {
22+
contract('BaseRewardEscrowV2', async accounts => {
2323
const WEEK = 604800;
2424
const YEAR = 31556926;
2525

test/contracts/BaseSynthetix.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const {
2121

2222
const { toBytes32 } = require('../..');
2323

24-
contract('BaseSynthetix @ovm-skip', async accounts => {
24+
contract('BaseSynthetix', async accounts => {
2525
const [sUSD, sAUD, sEUR, SNX, sETH] = ['sUSD', 'sAUD', 'sEUR', 'SNX', 'sETH'].map(toBytes32);
2626

2727
const [, owner, account1, account2, account3] = accounts;

test/contracts/BinaryOption.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let BinaryOption;
1313

1414
const ZERO_ADDRESS = '0x' + '0'.repeat(40);
1515

16-
contract('BinaryOption @gas-skip @ovm-skip', accounts => {
16+
contract('BinaryOption @gas-skip', accounts => {
1717
const [account, bidder, recipient] = accounts;
1818

1919
const biddingTime = 100;

test/contracts/BinaryOptionMarket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const computePrices = (longs, shorts, debt, fee) => {
3838
};
3939
};
4040

41-
contract('BinaryOptionMarket @gas-skip @ovm-skip', accounts => {
41+
contract('BinaryOptionMarket @gas-skip', accounts => {
4242
const [initialBidder, newBidder, pauper] = accounts;
4343

4444
const ZERO_ADDRESS = '0x' + '0'.repeat(40);

test/contracts/BinaryOptionMarketData.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { setupContract, setupAllContracts } = require('./setup');
66
const { currentTime, toUnit } = require('../utils')();
77
const { toBytes32 } = require('../..');
88

9-
contract('BinaryOptionMarketData @gas-skip @ovm-skip', accounts => {
9+
contract('BinaryOptionMarketData @gas-skip', accounts => {
1010
let market, setupTime, dataContract;
1111

1212
before(async () => {

test/contracts/BinaryOptionMarketManager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const computePrices = (longs, shorts, debt, fee) => {
3030
};
3131
};
3232

33-
contract('BinaryOptionMarketManager @gas-skip @ovm-skip', accounts => {
33+
contract('BinaryOptionMarketManager @gas-skip', accounts => {
3434
const [initialCreator, managerOwner, bidder, dummy] = accounts;
3535

3636
const sUSDQty = toUnit(10000);

test/contracts/Bytes32SetLib.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const TestableBytes32Set = artifacts.require('TestableBytes32Set');
44

55
const { toBytes32 } = require('../..');
66

7-
contract('Bytes32SetLib @ovm-skip', accounts => {
7+
contract('Bytes32SetLib', accounts => {
88
let set;
99

1010
const testBytes32 = ['a', 'b', 'c', 'd', 'e'].map(toBytes32);

test/contracts/Collateral.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const { ensureOnlyExpectedMutativeFunctions } = require('./helpers');
66

77
let Collateral;
88

9-
contract('Collateral @ovm-skip', async accounts => {
9+
contract('Collateral', async accounts => {
1010
before(async () => {
1111
Collateral = artifacts.require(`Collateral`);
1212
});

test/contracts/CollateralErc20.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let CollateralState;
2525
let ProxyERC20;
2626
let TokenState;
2727

28-
contract('CollateralErc20 @ovm-skip', async accounts => {
28+
contract('CollateralErc20', async accounts => {
2929
const YEAR = 31536000;
3030
const INTERACTION_DELAY = 300;
3131

test/contracts/CollateralEth.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let CollateralManager;
2121
let CollateralState;
2222
let CollateralManagerState;
2323

24-
contract('CollateralEth @ovm-skip', async accounts => {
24+
contract('CollateralEth', async accounts => {
2525
const YEAR = 31556926;
2626
const INTERACTION_DELAY = 300;
2727

test/contracts/CollateralManager.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let CollateralManager;
1919
let CollateralState;
2020
let CollateralManagerState;
2121

22-
contract('CollateralManager @ovm-skip', async accounts => {
22+
contract('CollateralManager', async accounts => {
2323
const [deployerAccount, owner, oracle, , account1] = accounts;
2424

2525
const sETH = toBytes32('sETH');

test/contracts/CollateralShort.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ let CollateralManager;
1919
let CollateralState;
2020
let CollateralManagerState;
2121

22-
contract('CollateralShort @ovm-skip', async accounts => {
22+
contract('CollateralShort', async accounts => {
2323
const YEAR = 31556926;
2424

2525
const sUSD = toBytes32('sUSD');

test/contracts/ContractStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { ensureOnlyExpectedMutativeFunctions, onlyGivenAddressCanInvoke } = requi
1010
const ContractStorage = artifacts.require('MockContractStorage');
1111
const AddressResolver = artifacts.require('AddressResolver');
1212

13-
contract('ContractStorage @ovm-skip', accounts => {
13+
contract('ContractStorage', accounts => {
1414
const [deployerAccount, owner, account1, account2] = accounts;
1515

1616
let storage;

test/contracts/DappMaintenance.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { assert, addSnapshotBeforeRestoreAfterEach } = require('./common');
55

66
const { setupAllContracts } = require('./setup');
77

8-
contract('DappMaintenance @ovm-skip', accounts => {
8+
contract('DappMaintenance', accounts => {
99
const [, ownerAccount, account1] = accounts;
1010
let dappMaintenance;
1111

test/contracts/DebtCache.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const {
2222
defaults: { DEBT_SNAPSHOT_STALE_TIME },
2323
} = require('../..');
2424

25-
contract('DebtCache @ovm-skip', async accounts => {
25+
contract('DebtCache', async accounts => {
2626
const [sUSD, sAUD, sEUR, SNX, sETH] = ['sUSD', 'sAUD', 'sEUR', 'SNX', 'sETH'].map(toBytes32);
2727
const synthKeys = [sUSD, sAUD, sEUR, sETH, SNX];
2828

test/contracts/DelegateApprovals.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {
1212
constants: { ZERO_ADDRESS },
1313
} = require('../..');
1414

15-
contract('DelegateApprovals @ovm-skip', async accounts => {
15+
contract('DelegateApprovals', async accounts => {
1616
const [deployerAccount, owner, account1, account2, account3] = accounts;
1717

1818
let delegateApprovals;

test/contracts/Depot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const { GAS_PRICE } = require('../../hardhat.config');
2525

2626
const { toBytes32 } = require('../..');
2727

28-
contract('Depot @ovm-skip', async accounts => {
28+
contract('Depot', async accounts => {
2929
let synthetix, synth, depot, addressResolver, systemStatus, exchangeRates, ethRate, snxRate;
3030

3131
const [, owner, oracle, fundsWallet, address1, address2, address3] = accounts;

test/contracts/EternalStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const {
1010
constants: { ZERO_ADDRESS },
1111
} = require('../..');
1212

13-
contract('EternalStorage @ovm-skip', accounts => {
13+
contract('EternalStorage', accounts => {
1414
const EternalStorage = artifacts.require('EternalStorage');
1515
const [deployerAccount, owner, associatedContract, account1] = accounts;
1616
let eternalStorage;

test/contracts/EtherCollateral.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const {
2020

2121
const { toBytes32 } = require('../..');
2222

23-
contract('EtherCollateral @ovm-skip', async accounts => {
23+
contract('EtherCollateral', async accounts => {
2424
const MINUTE = 60;
2525
const DAY = 86400;
2626
const WEEK = 604800;

test/contracts/EtherCollateralsUSD.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const {
2323
constants: { ZERO_ADDRESS },
2424
} = require('../..');
2525

26-
contract('EtherCollateralsUSD @ovm-skip', async accounts => {
26+
contract('EtherCollateralsUSD', async accounts => {
2727
const MINUTE = 60;
2828
const DAY = 86400;
2929
const WEEK = 604800;

test/contracts/ExchangeRates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const createRandomKeysAndRates = quantity => {
4848
return { currencyKeys, rates };
4949
};
5050

51-
contract('Exchange Rates @ovm-skip', async accounts => {
51+
contract('Exchange Rates', async accounts => {
5252
const [deployerAccount, owner, oracle, accountOne, accountTwo] = accounts;
5353
const [SNX, sJPY, sXTZ, sBNB, sUSD, sEUR, sAUD, fastGasPrice] = [
5454
'SNX',

test/contracts/ExchangeState.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const { isBN } = require('web3-utils');
1212

1313
const ExchangeState = artifacts.require('ExchangeState');
1414

15-
contract('ExchangeState @ovm-skip', accounts => {
15+
contract('ExchangeState', accounts => {
1616
const [
1717
deployerAccount,
1818
owner, // Oracle next, is not needed

test/contracts/Exchanger.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const bnCloseVariance = '30';
3030

3131
const MockAggregator = artifacts.require('MockAggregatorV2V3');
3232

33-
contract('Exchanger (spec tests) @ovm-skip', async accounts => {
33+
contract('Exchanger (spec tests)', async accounts => {
3434
const [sUSD, sAUD, sEUR, SNX, sBTC, iBTC, sETH, iETH] = [
3535
'sUSD',
3636
'sAUD',

test/contracts/ExchangerWithVirtualSynth.unit.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const { toBytes32 } = require('../..');
1010

1111
let ExchangerWithVirtualSynth;
1212

13-
contract('ExchangerWithVirtualSynth (unit tests) @ovm-skip', async accounts => {
13+
contract('ExchangerWithVirtualSynth (unit tests)', async accounts => {
1414
const [, owner] = accounts;
1515

1616
before(async () => {

test/contracts/ExternStateToken.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const {
1313

1414
const { onlyGivenAddressCanInvoke, ensureOnlyExpectedMutativeFunctions } = require('./helpers');
1515

16-
contract('ExternStateToken @ovm-skip', async accounts => {
16+
contract('ExternStateToken', async accounts => {
1717
const [deployerAccount, owner, account1, account2, account3] = accounts;
1818

1919
let proxy;

test/contracts/FeePool.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const {
3333
defaults: { ISSUANCE_RATIO, FEE_PERIOD_DURATION, TARGET_THRESHOLD },
3434
} = require('../..');
3535

36-
contract('FeePool @ovm-skip', async accounts => {
36+
contract('FeePool', async accounts => {
3737
const [deployerAccount, owner, oracle, account1, account2] = accounts;
3838

3939
// Updates rates with defaults so they're not stale.

test/contracts/FeePoolEternalStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const {
1010
constants: { ZERO_ADDRESS },
1111
} = require('../..');
1212

13-
contract('FeePoolEternalStorage @ovm-skip', accounts => {
13+
contract('FeePoolEternalStorage', accounts => {
1414
const FeePoolEternalStorage = artifacts.require('FeePoolEternalStorage');
1515
const [deployerAccount, ownerAccount, feePoolAddress, account1, account2, account3] = accounts;
1616
let feePool, feePoolEternalStorage;

test/contracts/FeePoolState.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { onlyGivenAddressCanInvoke, ensureOnlyExpectedMutativeFunctions } = requi
99

1010
const FeePoolState = artifacts.require('FeePoolState');
1111

12-
contract('FeePoolState @ovm-skip', async accounts => {
12+
contract('FeePoolState', async accounts => {
1313
const [
1414
deployerAccount,
1515
owner,

test/contracts/FlexibleStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const { ensureOnlyExpectedMutativeFunctions, onlyGivenAddressCanInvoke } = requi
1313
const AddressResolver = artifacts.require('AddressResolver');
1414
const FlexibleStorage = artifacts.require('FlexibleStorage');
1515

16-
contract('FlexibleStorage @ovm-skip', accounts => {
16+
contract('FlexibleStorage', accounts => {
1717
const [deployerAccount, owner, account1, account2, account3] = accounts;
1818

1919
let storage;

test/contracts/ImportableRewardEscrowV2.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { ensureOnlyExpectedMutativeFunctions } = require('./helpers');
1414
// constants: { ZERO_ADDRESS },
1515
// } = require('../..');
1616

17-
contract('ImportableRewardEscrowV2 @ovm-skip', async accounts => {
17+
contract('ImportableRewardEscrowV2', async accounts => {
1818
const [, owner, account1] = accounts;
1919
let importableRewardEscrowV2;
2020

0 commit comments

Comments
 (0)