paralel test

pull/4837/head
filip mertens 7 months ago
parent 614cd14dc6
commit 9a06e8022e
  1. 3
      .circleci/config.yml
  2. 2
      apps/remix-ide/src/remixAppManager.js
  3. 14
      apps/remixdesktop/run_ci_test.sh
  4. 35
      apps/remixdesktop/splice_tests.js
  5. 2
      apps/remixdesktop/src/plugins/xtermPlugin.ts
  6. 1
      apps/remixdesktop/test/tests/app/git.test.ts
  7. 1
      apps/remixdesktop/test/tests/app/offline.test.ts

@ -110,6 +110,7 @@ jobs:
resource_class: resource_class:
xlarge xlarge
working_directory: ~/remix-project working_directory: ~/remix-project
parallelism: 10
steps: steps:
- run: ldd --version - run: ldd --version
- checkout - checkout
@ -130,7 +131,7 @@ jobs:
name: "Run tests" name: "Run tests"
command: | command: |
cd apps/remixdesktop/ cd apps/remixdesktop/
yarn run build:e2e && yarn run test:offline && yarn run test && yarn run test:isogit ./run_test.sh
build-remixdesktop-linux: build-remixdesktop-linux:
machine: machine:

@ -282,7 +282,7 @@ export class RemixAppManager extends PluginManager {
} }
return plugins.map(plugin => { return plugins.map(plugin => {
if (plugin.name === 'dgit' && Registry.getInstance().get('platform').api.isDesktop()) { plugin.url = 'https://dgit4-76cc9.web.app/' } // temporary fix if (plugin.name === 'dgit') return null
if (plugin.name === testPluginName) plugin.url = testPluginUrl if (plugin.name === testPluginName) plugin.url = testPluginUrl
return new IframePlugin(plugin) return new IframePlugin(plugin)
}) })

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e
yarn run build:e2e && node ./splice_tests.js
TESTFILES=$(./splice_tests.js | circleci tests split --split-by=timings)
for TESTFILE in $TESTFILES; do
yarn run test --test ${TESTFILE} || TEST_EXITCODE=1
done
echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi

@ -0,0 +1,35 @@
const fs = require('fs');
const path = require('path');
// Directory to read files from
const testDirectory = './build-e2e/remixdesktop/test/tests/app/';
// Function to read files in a directory and return their paths
function getTestFiles(directory) {
return fs.readdirSync(directory)
.filter(file => file.endsWith('.test.js')) // Get only .test.js files
.map(file => path.join(directory, file)); // Return full path of each file
}
// Function to check if a file contains a specific word
function fileContainsWord(filePath, word) {
const content = fs.readFileSync(filePath, 'utf-8'); // Read file content
return content.includes(word); // Check if word is in content
}
// Function to filter out files that do not contain the specified word
function filterFilesByWord(files, word) {
return files.filter(file => fileContainsWord(file, word)); // Return files that do not contain the word
}
// Get all test files in the specified directory
const testFiles = getTestFiles(testDirectory);
// Filter out files that do not contain "@offline"
const filteredFiles = filterFilesByWord(testFiles, '');
// Output the list of filtered files
//console.log('Files without "@offline":', filteredFiles);
for (let i = 0; i < filteredFiles.length; i++) {
console.log(filteredFiles[i]);
}

@ -157,7 +157,7 @@ class XtermPluginClient extends ElectronBasePluginClient {
name: 'xterm-color', name: 'xterm-color',
cols: 80, cols: 80,
rows: 20, rows: 20,
cwd: path || process.cwd(), cwd: path || this.workingDir || process.cwd(),
env: env, env: env,
encoding: 'utf8', encoding: 'utf8',
}); });

@ -2,6 +2,7 @@ import { NightwatchBrowser } from 'nightwatch'
module.exports = { module.exports = {
'@isogit': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
done() done()
}, },

@ -2,6 +2,7 @@ import { NightwatchBrowser } from 'nightwatch'
module.exports = { module.exports = {
'@offline': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
done() done()
}, },

Loading…
Cancel
Save