You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2024/03/21 18:46:10 UTC

(superset) branch fix_docker_base updated (772d37ead3 -> 1bebd50743)

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a change to branch fix_docker_base
in repository https://gitbox.apache.org/repos/asf/superset.git


    from 772d37ead3 fix(docker): error around missing requirements/base.txt
     new 4fdf5a52da fix 'supersetbot docker' preset argument
     new 1bebd50743 add fix to supersetbot + unit test

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/supersetbot/src/cli.js      |  8 ++++----
 .github/supersetbot/src/cli.test.js | 19 +++++++++++++++++++
 2 files changed, 23 insertions(+), 4 deletions(-)
 create mode 100644 .github/supersetbot/src/cli.test.js


(superset) 02/02: add fix to supersetbot + unit test

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch fix_docker_base
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 1bebd507438a14ac4abe0238736dfbc8136b963b
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Thu Mar 21 11:45:52 2024 -0700

    add fix to supersetbot + unit test
---
 .github/supersetbot/src/cli.test.js | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/.github/supersetbot/src/cli.test.js b/.github/supersetbot/src/cli.test.js
new file mode 100644
index 0000000000..c2f1e8ecf5
--- /dev/null
+++ b/.github/supersetbot/src/cli.test.js
@@ -0,0 +1,19 @@
+import { spawnSync } from 'child_process';
+
+describe('CLI Test', () => {
+  it('should contain "--target dev" in the output when calling "supersetbot docker --preset dev --dry-run"', () => {
+    // Run the CLI command
+    const result = spawnSync('./src/supersetbot', ['docker', '--preset', 'dev', '--dry-run']);
+
+    if (result.error) {
+      // Handle the error, for example, by failing the test
+      throw new Error(result.error.message);
+    }
+
+    // Convert the stdout buffer to a string
+    const output = result.stdout.toString();
+
+    // Check if the output contains "--target dev"
+    expect(output).toContain('--target dev');
+  });
+});


(superset) 01/02: fix 'supersetbot docker' preset argument

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch fix_docker_base
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4fdf5a52da9743bdbf8830d67d601bfb515de90a
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Thu Mar 21 11:36:33 2024 -0700

    fix 'supersetbot docker' preset argument
---
 .github/supersetbot/src/cli.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/supersetbot/src/cli.js b/.github/supersetbot/src/cli.js
index b8344d6ac3..4b4612ee97 100755
--- a/.github/supersetbot/src/cli.js
+++ b/.github/supersetbot/src/cli.js
@@ -154,16 +154,16 @@ export default function getCLI(context) {
 
     program.command('docker')
       .description('Generates/run docker build commands use in CI')
-      .option('-t, --preset', 'Build preset', /^(lean|dev|dockerize|websocket|py310|ci)$/i, 'lean')
+      .option('-t, --preset <preset>', 'Build preset', /^(lean|dev|dockerize|websocket|py310|ci)$/i, 'lean')
       .option('-c, --context <context>', 'Build context', /^(push|pull_request|release)$/i, 'local')
       .option('-r, --context-ref <ref>', 'Reference to the PR, release, or branch')
       .option('-p, --platform <platform...>', 'Platforms (multiple values allowed)')
       .option('-f, --force-latest', 'Force the "latest" tag on the release')
       .option('-v, --verbose', 'Print more info')
-      .action(function (preset) {
-        const opts = context.processOptions(this);
+      .action(function () {
+        const opts = context.processOptions(this, ['preset']);
         opts.platform = opts.platform || ['linux/arm64'];
-        const cmd = docker.getDockerCommand({ preset, ...opts });
+        const cmd = docker.getDockerCommand({ ...opts });
         context.log(cmd);
         if (!opts.dryRun) {
           utils.runShellCommand(cmd, false);