diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index aa7efc13a8..1739070717 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -114,9 +114,9 @@ jobs: - name: Test run: | if ${{ env.ONLY_AFFECTED_TASKS }}; then - yarn test --ignore=@budibase/worker --ignore=@budibase/server --since=${{ env.NX_BASE_BRANCH }} + yarn test --ignore=@budibase/worker --ignore=@budibase/server --since=${{ env.NX_BASE_BRANCH }} -- --verbose --reporters=default --reporters=github-actions else - yarn test --ignore=@budibase/worker --ignore=@budibase/server + yarn test --ignore=@budibase/worker --ignore=@budibase/server --verbose --reporters=default --reporters=github-actions fi test-worker: @@ -138,11 +138,15 @@ jobs: - name: Test worker run: | if ${{ env.ONLY_AFFECTED_TASKS }}; then - node scripts/run-affected.js --task=test --scope=@budibase/worker --since=${{ env.NX_BASE_BRANCH }} - else - yarn test --scope=@budibase/worker + AFFECTED=$(yarn --silent nx show projects --affected -t test --base=${{ env.NX_BASE_BRANCH }} -p @budibase/worker) + if [ -z "$AFFECTED" ]; then + echo "No affected tests to run" + exit 0 + fi fi + yarn test --scope=@budibase/worker --verbose --reporters=default --reporters=github-actions + test-server: runs-on: ubuntu-latest strategy: diff --git a/packages/server/src/api/routes/tests/row.spec.ts b/packages/server/src/api/routes/tests/row.spec.ts index 95d44a86ba..5bdd341beb 100644 --- a/packages/server/src/api/routes/tests/row.spec.ts +++ b/packages/server/src/api/routes/tests/row.spec.ts @@ -565,7 +565,7 @@ datasourceDescribe( const row = await config.api.row.save(table._id!, { food: ["orange"], }) - expect(row.food).toEqual(["orangefdsfsd"]) + expect(row.food).toEqual(["orange"]) }) it("resets back to its default value when empty", async () => { diff --git a/scripts/run-affected.js b/scripts/run-affected.js deleted file mode 100755 index 97f79bb463..0000000000 --- a/scripts/run-affected.js +++ /dev/null @@ -1,34 +0,0 @@ -/*** - * Running lerna with since and scope is not working as expected. - * For example, running the command `yarn test --scope=@budibase/worker --since=master`, with changes only on `@budibase/backend-core` will not work as expected, as it does not analyse the dependencies properly. The actual `@budibase/worker` task will not be triggered. - * - * This script is using `lerna ls` to detect all the affected projects from a given commit, and if the scoped package is affected, the actual command will be executed. - * - * The current version of the script only supports a single project in the scope. - */ - -const { execSync } = require("child_process") - -const argv = require("yargs").demandOption(["task", "since", "scope"]).argv - -const { task, since, scope } = argv - -const affectedPackages = execSync( - `yarn --silent nx show projects --affected -t ${task} --base=${since} --json`, - { - encoding: "utf-8", - } -) - -const packages = JSON.parse(affectedPackages) - -const isAffected = packages.includes(scope) - -if (isAffected) { - console.log(`${scope} is affected. Running task "${task}"`) - execSync(`yarn ${task} --scope=${scope}`, { - stdio: "inherit", - }) -} else { - console.log(`${scope} is not affected. Skipping task "${task}"`) -}