pull/5370/head
filip mertens 2 years ago
commit 3b18e73dd7
  1. 96
      .circleci/config.yml
  2. 3
      apps/etherscan/project.json
  3. 23
      apps/remix-ide-e2e/package.json
  4. 14
      apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts
  5. 13
      apps/remix-ide-e2e/src/local-plugin/project.json
  6. 2
      apps/remix-ide-e2e/src/tests/etherscan_api.ts
  7. 2
      apps/remix-ide-e2e/src/tests/plugin_api.ts
  8. 2
      apps/remix-ide-e2e/src/tests/remixd.test.ts
  9. 1
      apps/remix-ide-e2e/src/tests/runAndDeploy.test.ts
  10. 8
      apps/remix-ide-e2e/src/tests/specialFunctions.test.ts
  11. 1
      apps/remix-ide-e2e/src/tests/terminal.test.ts
  12. 2
      apps/remix-ide-e2e/src/tests/transactionExecution.test.ts
  13. 2
      apps/remix-ide-e2e/src/tests/vyper_api.ts
  14. 3936
      apps/remix-ide-e2e/yarn.lock
  15. 3
      apps/remix-ide/ci/browser_test.sh
  16. 6
      apps/remix-ide/ci/browser_test_plugin.sh
  17. 26
      apps/remix-ide/ci/browser_tests_etherscan_plugin.sh
  18. 26
      apps/remix-ide/ci/browser_tests_vyper_plugin.sh
  19. 5
      apps/remix-ide/ci/flaky.sh
  20. 25
      apps/remix-ide/src/app/plugins/code-format.ts
  21. 3
      apps/vyper/project.json
  22. 2
      package.json
  23. 8
      yarn.lock

@ -24,21 +24,55 @@ jobs:
key: v1-deps-{{ checksum "yarn.lock" }} key: v1-deps-{{ checksum "yarn.lock" }}
paths: paths:
- node_modules - node_modules
- run: NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build:production - run:
- run: yarn nx build remix-ide-e2e-src-local-plugin & yarn run build:libs name: Build
- run: yarn nx run remixd:build command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build:production
else
NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build
fi
- run: yarn run build:e2e
- run: mkdir persist && zip -0 -r persist/dist.zip dist - run: mkdir persist && zip -0 -r persist/dist.zip dist
- persist_to_workspace: - persist_to_workspace:
root: . root: .
paths: paths:
- "persist" - "persist"
build-plugin:
docker:
- image: cimg/node:14.17.6-browsers
resource_class:
xlarge
working_directory: ~/remix-project
parameters:
plugin:
type: string
steps:
- checkout
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- save_cache:
key: v1-deps-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn build << parameters.plugin >>
- run: mkdir persist && zip -0 -r persist/plugin-<< parameters.plugin >>.zip dist
- persist_to_workspace:
root: .
paths:
- "persist"
lint: lint:
docker: docker:
- image: cimg/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
resource_class: resource_class:
xlarge xlarge
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 1
steps: steps:
- checkout - checkout
- restore_cache: - restore_cache:
@ -60,11 +94,11 @@ jobs:
- checkout - checkout
- attach_workspace: - attach_workspace:
at: . at: .
- run: unzip ./persist/dist.zip
- restore_cache: - restore_cache:
keys: keys:
- v1-deps-{{ checksum "yarn.lock" }} - v1-deps-{{ checksum "yarn.lock" }}
- run: yarn - run: yarn
- run: yarn build:libs
- run: cd dist/libs/remix-tests && yarn - run: cd dist/libs/remix-tests && yarn
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-url-resolver ../../libs/remix-url-resolver
- run: cd dist/libs/remix-tests && yarn add @remix-project/remix-lib ../../libs/remix-lib - run: cd dist/libs/remix-tests && yarn add @remix-project/remix-lib ../../libs/remix-lib
@ -118,11 +152,7 @@ jobs:
- attach_workspace: - attach_workspace:
at: . at: .
- run: unzip ./persist/dist.zip - run: unzip ./persist/dist.zip
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist - run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist
- run: ls -la ./dist/apps/remix-ide/assets/js - run: ls -la ./dist/apps/remix-ide/assets/js
- run: yarn run selenium-install || yarn run selenium-install - run: yarn run selenium-install || yarn run selenium-install
@ -149,9 +179,12 @@ jobs:
xlarge xlarge
working_directory: ~/remix-project working_directory: ~/remix-project
parameters: parameters:
script: plugin:
type: string type: string
parallelism: 4 parallelism:
type: integer
default: 1
parallelism: << parameters.parallelism >>
steps: steps:
- browser-tools/install-browser-tools: - browser-tools/install-browser-tools:
install-firefox: false install-firefox: false
@ -164,19 +197,16 @@ jobs:
- checkout - checkout
- attach_workspace: - attach_workspace:
at: . at: .
- restore_cache:
keys:
- v1-deps-{{ checksum "yarn.lock" }}
- run: yarn
- run: unzip ./persist/dist.zip - run: unzip ./persist/dist.zip
- run: unzip ./persist/plugin-<< parameters.plugin >>.zip
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist - run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist
- run: yarn run selenium-install || yarn run selenium-install - run: yarn run selenium-install || yarn run selenium-install
- run: - run:
name: Start Selenium name: Start Selenium
command: yarn run selenium command: yarn run selenium
background: true background: true
- run: ./apps/remix-ide/ci/<< parameters.script >> - run: ./apps/remix-ide/ci/browser_test_plugin.sh << parameters.plugin >>
- store_test_results: - store_test_results:
path: ./reports/tests path: ./reports/tests
- store_artifacts: - store_artifacts:
@ -273,18 +303,32 @@ workflows:
unless: << pipeline.parameters.run_flaky_tests >> unless: << pipeline.parameters.run_flaky_tests >>
jobs: jobs:
- build - build
- build-plugin:
matrix:
parameters:
plugin: ["etherscan", "vyper", "plugin_api"]
- lint: - lint:
requires: requires:
- build - build
- remix-libs: - remix-libs
requires:
- build
- remix-test-plugins: - remix-test-plugins:
name: test-plugin-<< matrix.plugin >>
requires: requires:
- build - build
- build-plugin
matrix: matrix:
alias: plugins
parameters: parameters:
script: ["browser_tests_plugin_api.sh", "browser_tests_etherscan_plugin.sh", "browser_tests_vyper_plugin.sh"] plugin: ["etherscan", "vyper", "plugin_api"]
parallelism: [1, 9]
exclude:
- plugin: plugin_api
parallelism: 1
- plugin: etherscan
parallelism: 9
- plugin: vyper
parallelism: 9
- remix-ide-browser: - remix-ide-browser:
requires: requires:
- build - build
@ -299,13 +343,13 @@ workflows:
- lint - lint
- remix-libs - remix-libs
- remix-ide-browser - remix-ide-browser
- remix-test-plugins - plugins
- deploy-remix-live: - deploy-remix-live:
requires: requires:
- lint - lint
- remix-libs - remix-libs
- remix-ide-browser - remix-ide-browser
- remix-test-plugins - plugins
filters: filters:
branches: branches:
only: remix_live only: remix_live
@ -314,7 +358,7 @@ workflows:
- lint - lint
- remix-libs - remix-libs
- remix-ide-browser - remix-ide-browser
- remix-test-plugins - plugins
filters: filters:
branches: branches:
only: master only: master
@ -323,7 +367,7 @@ workflows:
- lint - lint
- remix-libs - remix-libs
- remix-ide-browser - remix-ide-browser
- remix-test-plugins - plugins
filters: filters:
branches: branches:
only: remix_beta only: remix_beta

@ -3,9 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json", "$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/etherscan/src", "sourceRoot": "apps/etherscan/src",
"projectType": "application", "projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/webpack:webpack", "executor": "@nrwl/webpack:webpack",

@ -0,0 +1,23 @@
{
"name": "remix-ide-e2e",
"license": "MIT",
"engines": {
"node": "^14.17.6",
"npm": "^6.14.15"
},
"dependencies": {
"@openzeppelin/contracts": "^4.7.3",
"@openzeppelin/contracts-upgradeable": "^4.8.1",
"@openzeppelin/upgrades-core": "^1.22.0",
"@openzeppelin/wizard": "^0.1.1",
"@remix-project/remixd": "../../dist/libs/remixd",
"deep-equal": "^1.0.1",
"ganache-cli": "^6.8.1",
"selenium-standalone": "^8.2.3",
"tree-kill": "^1.2.2"
},
"devDependencies": {
"http-server": "^14.1.1",
"nightwatch": "2.3"
}
}

@ -5,14 +5,14 @@ import EventEmitter from 'events'
Check if the last log in the console contains a specific text Check if the last log in the console contains a specific text
*/ */
class JournalLastChildIncludes extends EventEmitter { class JournalLastChildIncludes extends EventEmitter {
command (this: NightwatchBrowser, val: string): NightwatchBrowser { command(this: NightwatchBrowser, val: string): NightwatchBrowser {
this.api this.api
.waitForElementVisible('*[data-id="terminalJournal"]', 10000) .waitForElementPresent({
.pause(1000) selector: `//*[@data-id='terminalJournal' and contains(.,'${val}')]`,
.getText('*[data-id="terminalJournal"]', (result) => { timeout: 10000,
console.log('JournalLastChildIncludes', result.value) locateStrategy: 'xpath'
if (typeof result.value === 'string' && result.value.indexOf(val) === -1) return this.api.assert.fail(`wait for ${val} in ${result.value}`) }).perform((done) => {
else this.api.assert.ok(true, `<*[data-id="terminalJournal"]> contains ${val}.`) done()
this.emit('complete') this.emit('complete')
}) })
return this return this

@ -1,11 +1,8 @@
{ {
"name": "remix-ide-e2e-src-local-plugin", "name": "plugin_api",
"$schema": "../../node_modules/nx/schemas/project-schema.json", "$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/remix-ide-e2e/src/local-plugin/src/", "sourceRoot": "apps/remix-ide-e2e/src/local-plugin/src/",
"projectType": "application", "projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/webpack:webpack", "executor": "@nrwl/webpack:webpack",
@ -13,7 +10,7 @@
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"compiler": "babel", "compiler": "babel",
"outputPath": "dist/apps/remix-ide-e2e-src-local-plugin", "outputPath": "dist/apps/plugin_api",
"index": "apps/remix-ide-e2e/src/local-plugin/src/index.html", "index": "apps/remix-ide-e2e/src/local-plugin/src/index.html",
"baseHref": "/", "baseHref": "/",
"main": "apps/remix-ide-e2e/src/local-plugin/src/main.tsx", "main": "apps/remix-ide-e2e/src/local-plugin/src/main.tsx",
@ -44,16 +41,16 @@
"executor": "@nrwl/webpack:dev-server", "executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build", "buildTarget": "plugin_api:build",
"hmr": true "hmr": true
}, },
"configurations": { "configurations": {
"development": { "development": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build:development", "buildTarget": "plugin_api:build:development",
"port": 2020 "port": 2020
}, },
"production": { "production": {
"buildTarget": "remix-ide-e2e-src-local-plugin:build:production" "buildTarget": "plugin_api:build:production"
} }
} }
} }

@ -9,7 +9,7 @@ declare global {
module.exports = { module.exports = {
'@disabled': true, '@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null, true, { name: 'etherscan', url: 'http://127.0.0.1:5003'}) init(browser, done, null, true, { name: 'etherscan', url: 'http://127.0.0.1:9999'})
}, },
'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) { 'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) {

@ -11,7 +11,7 @@ const localPluginData: Profile & LocationProfile & ExternalProfile = {
name: 'localPlugin', name: 'localPlugin',
displayName: 'Local Plugin', displayName: 'Local Plugin',
canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting', 'udapp', 'hardhat-provider'], canActivate: ['dGitProvider', 'flattener', 'solidityUnitTesting', 'udapp', 'hardhat-provider'],
url: 'http://localhost:2020', url: 'http://localhost:9999',
location: 'sidePanel' location: 'sidePanel'
} }

@ -312,7 +312,7 @@ function testImportFromRemixd(browser: NightwatchBrowser, callback: VoidFunction
} }
async function spawnRemixd(path: string): Promise<ChildProcess> { async function spawnRemixd(path: string): Promise<ChildProcess> {
const remixd = spawn('yarn run remixd', [`-s ${path}`], { cwd: process.cwd(), shell: true, detached: true }) const remixd = spawn('chmod +x dist/libs/remixd/src/bin/remixd.js && dist/libs/remixd/src/bin/remixd.js --remix-ide http://127.0.0.1:8080', [`-s ${path}`], { cwd: process.cwd(), shell: true, detached: true })
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
remixd.stdout.on('data', function (data) { remixd.stdout.on('data', function (data) {
if( if(

@ -224,7 +224,6 @@ module.exports = {
'Call web3.eth.getAccounts() using Injected Provider (Metamask)': !function (browser: NightwatchBrowser) { 'Call web3.eth.getAccounts() using Injected Provider (Metamask)': !function (browser: NightwatchBrowser) {
browser browser
.executeScriptInTerminal('web3.eth.getAccounts()') .executeScriptInTerminal('web3.eth.getAccounts()')
.pause(2000)
.journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]') .journalLastChildIncludes('[ "0x76a3ABb5a12dcd603B52Ed22195dED17ee82708f" ]')
.end() .end()
} }

@ -29,7 +29,6 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa') browser.sendLowLevelTx(address, '0', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 0 wei') .journalLastChildIncludes('value: 0 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')
@ -67,7 +66,6 @@ module.exports = {
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
@ -80,7 +78,6 @@ module.exports = {
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '10', '0xaa') browser.sendLowLevelTx(address, '10', '0xaa')
.pause(1000)
.journalLastChildIncludes('to CheckSpecials.(fallback) errored:') .journalLastChildIncludes('to CheckSpecials.(fallback) errored:')
.journalLastChildIncludes('The called function should be payable if you send value') .journalLastChildIncludes('The called function should be payable if you send value')
.perform(done()) .perform(done())
@ -97,7 +94,6 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(receive)') .journalLastChildIncludes('to: CheckSpecials.(receive)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
@ -110,7 +106,6 @@ module.exports = {
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '0', '0xaa') browser.sendLowLevelTx(address, '0', '0xaa')
.pause(1000)
.waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`) .waitForElementVisible(`#instance${address} label[id="deployAndRunLLTxError"]`)
.assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined') .assert.containsText(`#instance${address} label[id="deployAndRunLLTxError"]`, '\'Fallback\' function is not defined')
.perform(done()) .perform(done())
@ -127,7 +122,6 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '') browser.sendLowLevelTx(address, '1', '')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0x') .journalLastChildIncludes('data: 0x')
@ -140,7 +134,6 @@ module.exports = {
browser.perform((done) => { browser.perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '1', '0xaa') browser.sendLowLevelTx(address, '1', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 1 wei') .journalLastChildIncludes('value: 1 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')
@ -180,7 +173,6 @@ module.exports = {
.perform((done) => { .perform((done) => {
browser.getAddressAtPosition(0, (address) => { browser.getAddressAtPosition(0, (address) => {
browser.sendLowLevelTx(address, '999999998765257135', '0xaa') browser.sendLowLevelTx(address, '999999998765257135', '0xaa')
.pause(1000)
.journalLastChildIncludes('to: CheckSpecials.(fallback)') .journalLastChildIncludes('to: CheckSpecials.(fallback)')
.journalLastChildIncludes('value: 999999998765257135 wei') .journalLastChildIncludes('value: 999999998765257135 wei')
.journalLastChildIncludes('data: 0xaa') .journalLastChildIncludes('data: 0xaa')

@ -202,7 +202,6 @@ module.exports = {
.addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script }) .addFile('scripts/deploy_storage.js', { content: scriptAutoExec.script })
.openFile('contracts/storage.sol') .openFile('contracts/storage.sol')
.sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's']) .sendKeys('body', [browser.Keys.CONTROL, browser.Keys.SHIFT, 's'])
.pause(15000)
.journalLastChildIncludes('147') .journalLastChildIncludes('147')
}, },

@ -141,7 +141,6 @@ module.exports = {
.click('.udapp_contractActionsContainerSingle > button') .click('.udapp_contractActionsContainerSingle > button')
.clickInstance(0) .clickInstance(0)
.clickFunction('g - transact (not payable)') .clickFunction('g - transact (not payable)')
.pause(5000)
.journalLastChildIncludes('Error provided by the contract:') .journalLastChildIncludes('Error provided by the contract:')
.journalLastChildIncludes('CustomError : error description') .journalLastChildIncludes('CustomError : error description')
.journalLastChildIncludes('Parameters:') .journalLastChildIncludes('Parameters:')
@ -182,7 +181,6 @@ module.exports = {
.click('.udapp_contractActionsContainerSingle > button') .click('.udapp_contractActionsContainerSingle > button')
.clickInstance(1) .clickInstance(1)
.clickFunction('h - transact (not payable)') .clickFunction('h - transact (not payable)')
.pause(5000)
.journalLastChildIncludes('Error provided by the contract:') .journalLastChildIncludes('Error provided by the contract:')
.journalLastChildIncludes('CustomError : error description from library') .journalLastChildIncludes('CustomError : error description from library')
.journalLastChildIncludes('Parameters:') .journalLastChildIncludes('Parameters:')

@ -9,7 +9,7 @@ declare global {
module.exports = { module.exports = {
'@disabled': true, '@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null, true, { name: 'vyper', url: 'http://127.0.0.1:5002'}) init(browser, done, null, true, { name: 'vyper', url: 'http://127.0.0.1:9999'})
}, },
'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) { 'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) {

File diff suppressed because it is too large Load Diff

@ -10,11 +10,8 @@ TEST_EXITCODE=0
yarn run ganache-cli & yarn run ganache-cli &
npx http-server -p 9090 --cors='*' ./node_modules & npx http-server -p 9090 --cors='*' ./node_modules &
yarn run serve:production & yarn run serve:production &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
sleep 5 sleep 5
yarn run build:e2e
# grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]" # grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]"
# TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[$2]" | circleci tests split --split-by=timings ) # TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[$2]" | circleci tests split --split-by=timings )
node apps/remix-ide/ci/splice_tests.js $2 $3 node apps/remix-ide/ci/splice_tests.js $2 $3

@ -6,16 +6,14 @@ BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID" echo "$BUILD_ID"
TEST_EXITCODE=0 TEST_EXITCODE=0
npx http-server -p 9999 ./dist/apps/$1 &
yarn run ganache-cli & yarn run ganache-cli &
npx http-server -p 9090 --cors='*' ./node_modules & npx http-server -p 9090 --cors='*' ./node_modules &
yarn run serve:production & yarn run serve:production &
npx nx serve remix-ide-e2e-src-local-plugin &
sleep 5 sleep 5
yarn run build:e2e TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep $1 | sort | circleci tests split )
TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "plugin_api" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done done

@ -1,26 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
yarn build etherscan
yarn run serve:production &
npx nx serve etherscan &
sleep 5
yarn run build:e2e
TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "etherscan_api" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -1,26 +0,0 @@
#!/usr/bin/env bash
set -e
BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0
yarn build vyper
yarn run serve:production &
npx nx serve vyper &
sleep 5
yarn run build:e2e
TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "vyper_api" | sort | circleci tests split )
for TESTFILE in $TESTFILES; do
npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -2,7 +2,6 @@
set -e set -e
yarn run build:e2e
TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.flaky" | sort ) TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "\.flaky" | sort )
# count test files # count test files
@ -19,10 +18,8 @@ echo "$BUILD_ID"
TEST_EXITCODE=0 TEST_EXITCODE=0
yarn run ganache-cli & yarn run ganache-cli &
npx http-server -p 9090 --cors='*' ./node_modules &
yarn run serve:production & yarn run serve:production &
echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' &
npx nx serve remix-ide-e2e-src-local-plugin &
sleep 5 sleep 5
for TESTFILE in $TESTFILES; do for TESTFILE in $TESTFILES; do

@ -1,12 +1,7 @@
'use strict' 'use strict'
import { Plugin } from '@remixproject/engine' import { Plugin } from '@remixproject/engine'
import prettier from 'prettier/standalone'
import { Options } from 'prettier'; import { Options } from 'prettier';
import sol from './code-format/index' import sol from './code-format/index'
import * as ts from 'prettier/parser-typescript'
import * as babel from 'prettier/parser-babel'
import * as espree from 'prettier/parser-espree'
import * as yml from 'prettier/parser-yaml'
import path from 'path' import path from 'path'
import yaml from 'js-yaml' import yaml from 'js-yaml'
import toml from 'toml' import toml from 'toml'
@ -67,12 +62,28 @@ const defaultOptions = {
export class CodeFormat extends Plugin { export class CodeFormat extends Plugin {
prettier: any
ts: any
babel: any
espree: any
yml: any
sol: any
constructor() { constructor() {
super(profile) super(profile)
} }
async format(file: string) { async format(file: string) {
// lazy load
if (!this.prettier) {
this.prettier = await import('prettier/standalone')
this.ts = await import('prettier/parser-typescript')
this.babel = await import('prettier/parser-babel')
this.espree = await import('prettier/parser-espree')
this.yml = await import('prettier/parser-yaml')
}
try { try {
const content = await this.call('fileManager', 'readFile', file) const content = await this.call('fileManager', 'readFile', file)
if (!content) return if (!content) return
@ -241,8 +252,8 @@ export class CodeFormat extends Plugin {
} }
const result = prettier.format(content, { const result = this.prettier.format(content, {
plugins: [sol as any, ts, babel, espree, yml], plugins: [sol as any, this.ts, this.babel, this.espree, this.yml],
parser: parserName, parser: parserName,
...options ...options
}) })

@ -3,9 +3,6 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json", "$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/vyper/src", "sourceRoot": "apps/vyper/src",
"projectType": "application", "projectType": "application",
"implicitDependencies": [
"remix-debug"
],
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/webpack:webpack", "executor": "@nrwl/webpack:webpack",

@ -176,7 +176,7 @@
"merge": "^2.1.1", "merge": "^2.1.1",
"npm-install-version": "^6.0.2", "npm-install-version": "^6.0.2",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"prettier": "^2.7.1", "prettier": "^2.8.4",
"prettier-plugin-solidity": "^1.0.0-beta.24", "prettier-plugin-solidity": "^1.0.0-beta.24",
"raw-loader": "^4.0.2", "raw-loader": "^4.0.2",
"react": "^17.0.2", "react": "^17.0.2",

@ -21259,10 +21259,10 @@ prettier-plugin-solidity@^1.0.0-beta.24:
solidity-comments-extractor "^0.0.7" solidity-comments-extractor "^0.0.7"
string-width "^4.2.3" string-width "^4.2.3"
prettier@^2.7.1: prettier@^2.8.4:
version "2.7.1" version "2.8.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3"
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g== integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==
pretty-format@^27.0.2: pretty-format@^27.0.2:
version "27.5.1" version "27.5.1"

Loading…
Cancel
Save