From 245c87f0262c39331d4b26dbd5a05b4b48778cf4 Mon Sep 17 00:00:00 2001 From: xianny Date: Wed, 25 Sep 2019 09:13:33 -0700 Subject: [PATCH] re-enable test-rest --- .circleci/config.yml | 155 ++---------------- package.json | 4 +- .../test/contract_artifacts_test.ts | 16 ++ 3 files changed, 28 insertions(+), 147 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8186488c83..8f1c349617 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,3 @@ -# NOTE: We're only focusing on contracts in the 3.0 branch currently, so -# we only run certain jobs until we're ready to reconcile other packages. - version: 2 jobs: @@ -117,11 +114,13 @@ jobs: - repo-{{ .Environment.CIRCLE_SHA1 }} - run: yarn wsrun test:circleci @0x/contracts-test-utils - run: yarn wsrun test:circleci @0x/abi-gen - - run: yarn wsrun test:circleci @0x/asset-buyer + # TODO (xianny): Needs to be updated for 3.0 + # - run: yarn wsrun test:circleci @0x/asset-buyer - run: yarn wsrun test:circleci @0x/contract-artifacts - run: yarn wsrun test:circleci @0x/assert - run: yarn wsrun test:circleci @0x/base-contract - - run: yarn wsrun test:circleci @0x/connect + # TODO (xianny): Needs to be updated for 3.0 + # - run: yarn wsrun test:circleci @0x/connect - run: yarn wsrun test:circleci @0x/contract-wrappers - run: yarn wsrun test:circleci @0x/dev-utils - run: yarn wsrun test:circleci @0x/json-schemas @@ -189,76 +188,6 @@ jobs: key: coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }} paths: - ~/repo/packages/web3-wrapper/coverage/lcov.info - test-rest-3.0: - resource_class: medium+ - docker: - - image: nikolaik/python-nodejs:python3.7-nodejs8 - working_directory: ~/repo - steps: - - restore_cache: - keys: - - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn wsrun test:circleci @0x/contracts-test-utils - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - run: yarn wsrun test:circleci-3.0 @0x/abi-gen - - run: yarn wsrun test:circleci @0x/assert - - run: yarn wsrun test:circleci @0x/base-contract - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - run: yarn wsrun test:circleci @0x/contract-wrappers - - run: yarn wsrun test:circleci @0x/dev-utils - - run: yarn wsrun test:circleci @0x/json-schemas - - run: yarn wsrun test:circleci @0x/order-utils - - run: yarn wsrun test:circleci @0x/sol-compiler - - run: yarn wsrun test:circleci @0x/sol-tracing-utils - - run: yarn wsrun test:circleci @0x/subproviders - - run: yarn wsrun test:circleci @0x/web3-wrapper - - run: yarn wsrun test:circleci @0x/utils - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - save_cache: - # key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }} - # paths: - # - ~/repo/packages/abi-gen/coverage/lcov.info - - save_cache: - key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/assert/coverage/lcov.info - - save_cache: - key: coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/base-contract/coverage/lcov.info - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - save_cache: - # key: coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }} - # paths: - # - ~/repo/packages/contract-wrappers/coverage/lcov.info - - save_cache: - key: coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/dev-utils/coverage/lcov.info - - save_cache: - key: coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/json-schemas/coverage/lcov.info - - save_cache: - key: coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/order-utils/coverage/lcov.info - - save_cache: - key: coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/sol-compiler/coverage/lcov.info - - save_cache: - key: coverage-sol-tracing-utils-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/sol-tracing-utils/coverage/lcov.info - - save_cache: - key: coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/subproviders/coverage/lcov.info - - save_cache: - key: coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }} - paths: - - ~/repo/packages/web3-wrapper/coverage/lcov.info test-python: working_directory: ~/repo docker: @@ -393,17 +322,6 @@ jobs: - run: yarn diff_md_docs:ci - run: cd packages/0x.js && yarn build:umd:prod - run: yarn bundlewatch - static-tests-3.0: - working_directory: ~/repo - docker: - - image: nikolaik/python-nodejs:python3.7-nodejs8 - steps: - - restore_cache: - keys: - - repo-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn lerna run lint - - run: yarn prettier:ci - - run: yarn deps_versions:ci submit-coverage: docker: - image: nikolaik/python-nodejs:python3.7-nodejs8 @@ -476,56 +394,6 @@ jobs: keys: - coverage-python-order-utils-{{ .Environment.CIRCLE_SHA1 }} - run: yarn report_coverage - submit-coverage-3.0: - docker: - - image: nikolaik/python-nodejs:python3.7-nodejs8 - working_directory: ~/repo - steps: - - restore_cache: - keys: - - repo-{{ .Environment.CIRCLE_SHA1 }} - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - restore_cache: - # keys: - # - coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-assert-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-base-contract-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-connect-{{ .Environment.CIRCLE_SHA1 }} - # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. - # - restore_cache: - # keys: - # - coverage-contract-wrappers-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-dev-utils-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-json-schemas-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-order-utils-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-sol-compiler-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-sol-tracing-utils-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-subproviders-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-web3-wrapper-{{ .Environment.CIRCLE_SHA1 }} - - restore_cache: - keys: - - coverage-contracts-{{ .Environment.CIRCLE_SHA1 }} - - run: yarn report_coverage workflows: version: 2 main: @@ -541,31 +409,28 @@ workflows: # - test-contracts-geth: # requires: # - build - - test-rest-3.0: + - test-rest: requires: - build - - static-tests-3.0: + - static-tests: requires: - build - # Disabled for 3.0 # - test-publish: # requires: # - build - # Disabled for 3.0 # - test-doc-generation: # requires: # - build - - submit-coverage-3.0: + - submit-coverage: requires: - test-contracts-rest-ganache-3.0 - test-exchange-ganache-3.0 - - test-rest-3.0 - - static-tests-3.0 - # Disabled for 3.0 + - test-rest + - static-tests # - test-python: # requires: # - build - # - test-rest-3.0 + # - test-rest # - static-tests-python: # requires: # - test-python diff --git a/package.json b/package.json index 7acd82269f..198e3e872d 100644 --- a/package.json +++ b/package.json @@ -61,11 +61,11 @@ "files": [ { "path": "packages/0x.js/_bundles/index.min.js", - "maxSize": "1150kB" + "maxSize": "1200kB" }, { "path": "packages/instant/umd/instant.js", - "maxSize": "1350kB" + "maxSize": "1400kB" } ], "ci": { diff --git a/packages/contract-artifacts/test/contract_artifacts_test.ts b/packages/contract-artifacts/test/contract_artifacts_test.ts index 69d0c3e37f..4cd63cf81d 100644 --- a/packages/contract-artifacts/test/contract_artifacts_test.ts +++ b/packages/contract-artifacts/test/contract_artifacts_test.ts @@ -9,6 +9,17 @@ import { FORBIDDEN_PROPERTIES, REQUIRED_PROPERTIES } from '../src/transform'; const expect = chai.expect; +const CONTRACTS_WITH_PURE_FNS = [ + // 'Coordinator', // missing deployedBytecode + 'DevUtils', + 'ERC1155Proxy', + 'ERC20Proxy', + 'ERC721Proxy', + 'IAssetProxy', + 'MultiAssetProxy', + 'StaticCallProxy', +]; + describe('Contract Artifacts', () => { it('should not include forbidden attributes', () => { const forbiddenPropertiesByArtifact: { [name: string]: string[] } = {}; @@ -33,6 +44,11 @@ describe('Contract Artifacts', () => { if (requiredProperty === 'compiler' && artifact.schemaVersion === '2.0.0') { continue; } + if (requiredProperty === 'compilerOutput.evm.deployedBytecode.object') { + if (!CONTRACTS_WITH_PURE_FNS.includes(artifactName)) { + continue; + } + } const requiredValue = get(artifact, requiredProperty); if (requiredValue === undefined || requiredValue === '') { const previousMissing = missingRequiredPropertiesByArtifact[artifactName];