Skip to content

Commit 3fc72ef

Browse files
committed
fix ut of bash and pwsh in plugin
1 parent 119063d commit 3fc72ef

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

core/src/test/java/com/flowci/core/test/plugin/PluginParserTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,13 @@ public void should_parse_yml_to_plugin() {
5656
Assert.assertEquals(2, exports.size());
5757
Assert.assertTrue(exports.contains("VAR_EXPORT_1"));
5858
Assert.assertTrue(exports.contains("VAR_EXPORT_2"));
59+
60+
String pwsh = plugin.getPwsh();
61+
Assert.assertNotNull(pwsh);
62+
Assert.assertEquals("$Env.PK_FILE=keyfile", pwsh.trim());
63+
64+
String bash = plugin.getBash();
65+
Assert.assertNotNull(bash);
66+
Assert.assertEquals("chmod 400 ${PK_FILE}", bash.trim());
5967
}
6068
}

core/src/test/resources/plugin.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stats:
3333
allow_failure: true
3434

3535
script: |
36-
PK_FILE=${FLOWCI_PLUGIN_WORKSPACE}/FLOWCI_RSA_PRIVATE_KEY
3736
chmod 400 ${PK_FILE}
38-
ssh-agent bash -c 'ssh-add ${PK_FILE}; git clone -b ${GIT_BRANCH} ${GIT_URL}'
37+
38+
pwsh: |
39+
$Env.PK_FILE=keyfile

0 commit comments

Comments
 (0)