Skip to content

Commit 27846eb

Browse files
committed
Few changes in tests to pass with the modifications applied to npm
1 parent fd8ce7b commit 27846eb

File tree

5 files changed

+71
-24
lines changed

5 files changed

+71
-24
lines changed

tests/1-grunt_process.bats

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ setup () {
4747
# When a third party library is added, developers need to commit
4848
# ignorefiles change since 3.2.
4949

50-
# Testing on in-dev 3.2dev
51-
create_git_branch 32-dev 5a1728df39116fc701cc907e85a638aa7674f416
52-
git_apply_fixture 32-thirdparty-lib-added.patch
50+
# Testing on v3.5.9
51+
create_git_branch 35-stable v3.5.9
52+
git_apply_fixture 35-thirdparty-lib-added.patch
5353

5454
# Run test
5555
ci_run grunt_process/grunt_process.sh
@@ -64,9 +64,9 @@ setup () {
6464
# When a 3rd party library is added, but we are checking a 3rd part plugin
6565
# we ignore any change in ignorefiles.
6666

67-
# Testing on in-dev 3.2dev
68-
create_git_branch 32-dev 5a1728df39116fc701cc907e85a638aa7674f416
69-
git_apply_fixture 32-thirdparty-lib-added.patch
67+
# Testing on v3.5.9
68+
create_git_branch 35-stable v3.5.9
69+
git_apply_fixture 35-thirdparty-lib-added.patch
7070

7171
# Run test
7272
export isplugin=1

tests/2-remote_branch_checker.bats

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ assert_prechecker () {
3131
assert_files_same $smurfxmlfixture $WORKSPACE/work/smurf.xml
3232
}
3333

34-
@test "remote_branch_checker/remote_branch_checker.sh: old branch failing" {
35-
# An extremely old branch running jshint..
36-
assert_prechecker local_ci_fixture_oldbranch MDLSITE-3899 v2.9.0-rc1
34+
@test "remote_branch_checker/remote_branch_checker.sh: old branch (38_STABLE) failing" {
35+
# An extremely old branch. MOODLE_38_STABLE (with node v14) is the oldest we support.
36+
# (note MOODLE_35_STABLE and up also is supported but not v3.5.0, v3.6.0... support came later and
37+
# we need to use always .0 versions in the tests as base, so 3.8.0 is the very first .0).
38+
assert_prechecker local_ci_fixture_oldbranch_38 MDLSITE-3899 v3.8.0
3739
}
3840

3941
@test "remote_branch_checker/remote_branch_checker.sh: all possible checks failing" {

tests/3-prepare_npm_stuff.bats

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ setup () {
6363
# Assert result.
6464
# Cannot know if install will success or no (depends if npm/node binaries are elsewhere)
6565
# (hence, we are not asserting the result, just that the case is handled)
66+
67+
# Note this can end with some warnings if npm/node is not installed elsewhere and with
68+
# exit status = 2, but, as commented above, we are not asserting that here (success / failure...)
69+
# so that's ok.
6670
assert_output --partial "INFO: nvm not found, installing via git"
6771
assert_output --partial "INFO: nvm git installation found, updating to latest release"
6872
assert_output --partial "INFO: using nvm version:"
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
From 4600d7d6fd5d5bd4f5bae80c3e89b838d95f2b1d Mon Sep 17 00:00:00 2001
1+
From 96ec9462a7d7a05f39af044020b63e371831ab05 Mon Sep 17 00:00:00 2001
22
From: Dan Poltawski <dan@moodle.com>
33
Date: Tue, 12 Jul 2016 11:23:56 +0100
4-
Subject: [PATCH 1/1] MDLSITE-4678 fixture: adding third party lib
4+
Subject: [PATCH] MDLSITE-4678 fixture: adding third party lib
55

66
---
77
lib/thirdpartylibs.xml | 6 ++++++
88
1 file changed, 6 insertions(+)
99

1010
diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml
11-
index 6440a73..3385d2f 100644
11+
index c14a3e01d4..ba719b5f84 100644
1212
--- a/lib/thirdpartylibs.xml
1313
+++ b/lib/thirdpartylibs.xml
14-
@@ -275,4 +275,10 @@
15-
<license>GPL</license>
16-
<version>2.3.0</version>
14+
@@ -323,4 +323,10 @@
15+
<license>MIT</license>
16+
<version>1.1.1</version>
1717
</library>
1818
+ <library>
1919
+ <location>integrationtest</location>
@@ -23,5 +23,5 @@ index 6440a73..3385d2f 100644
2323
+ </library>
2424
</libraries>
2525
--
26-
2.9.0
26+
2.39.1
2727

tests/fixtures/remote_branch_checker/local_ci_fixture_oldbranch.xml renamed to tests/fixtures/remote_branch_checker/local_ci_fixture_oldbranch_38.xml

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<?xml version="1.0"?>
2-
<smurf version="0.9.1" numerrors="4" numwarnings="1">
3-
<summary status="error" numerrors="4" numwarnings="1" condensedresult="smurf,error,4,1:phplint,success,0,0;phpcs,success,0,0;phpdoc,success,0,0;commit,error,3,0;savepoint,success,0,0;thirdparty,success,0,0;externalbackup,success,0,0;grunt,error,1,1;shifter,success,0,0;mustache,success,0,0">
2+
<smurf version="0.9.1" numerrors="9" numwarnings="1">
3+
<summary status="error" numerrors="9" numwarnings="1" condensedresult="smurf,error,9,1:phplint,success,0,0;phpcs,success,0,0;js,error,5,0;css,success,0,0;phpdoc,success,0,0;commit,error,3,0;savepoint,success,0,0;thirdparty,success,0,0;externalbackup,success,0,0;grunt,error,1,1;shifter,success,0,0;mustache,success,0,0;gherkin,success,0,0">
44
<detail name="phplint" status="success" numerrors="0" numwarnings="0"/>
55
<detail name="phpcs" status="success" numerrors="0" numwarnings="0"/>
6+
<detail name="js" status="error" numerrors="5" numwarnings="0"/>
7+
<detail name="css" status="success" numerrors="0" numwarnings="0"/>
68
<detail name="phpdoc" status="success" numerrors="0" numwarnings="0"/>
79
<detail name="commit" status="error" numerrors="3" numwarnings="0"/>
810
<detail name="savepoint" status="success" numerrors="0" numwarnings="0"/>
@@ -11,6 +13,7 @@
1113
<detail name="grunt" status="error" numerrors="1" numwarnings="1"/>
1214
<detail name="shifter" status="success" numerrors="0" numwarnings="0"/>
1315
<detail name="mustache" status="success" numerrors="0" numwarnings="0"/>
16+
<detail name="gherkin" status="success" numerrors="0" numwarnings="0"/>
1417
</summary>
1518
<check id="phplint" title="PHP lint problems" url="http://php.net/docs.php" numerrors="0" numwarnings="0" allowfiltering="0">
1619
<description>This section shows php lint problems in the code detected by php -l</description>
@@ -20,24 +23,58 @@
2023
<description>This section shows the coding style problems detected in the code by phpcs</description>
2124
<mess/>
2225
</check>
26+
<check id="js" title="Javascript coding style problems" url="https://docs.moodle.org/dev/Javascript/Coding_style" numerrors="5" numwarnings="0" allowfiltering="1">
27+
<description>This section shows the coding style problems detected in the code by eslint</description>
28+
<mess>
29+
<problem file="lib/amd/src/ajax.js" linefrom="42" lineto="42" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/lib/amd/src/ajax.js#L42" ruleset="eslint" rule="rules.no-unused-vars" url="https://docs.moodle.org/dev/Javascript/Coding_style" type="error" weight="5">
30+
<message>'foo' is assigned a value but never used. (no-unused-vars)</message>
31+
<description/>
32+
<code/>
33+
</problem>
34+
<problem file="lib/amd/src/ajax.js" linefrom="42" lineto="42" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/lib/amd/src/ajax.js#L42" ruleset="eslint" rule="rules.babel/semi" url="https://docs.moodle.org/dev/Javascript/Coding_style" type="error" weight="5">
35+
<message>Missing semicolon. (babel/semi)</message>
36+
<description/>
37+
<code/>
38+
</problem>
39+
<problem file="lib/javascript-static.js" linefrom="9" lineto="9" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/lib/javascript-static.js#L9" ruleset="eslint" rule="rules.no-unused-vars" url="https://docs.moodle.org/dev/Javascript/Coding_style" type="error" weight="5">
40+
<message>'foo' is assigned a value but never used. (no-unused-vars)</message>
41+
<description/>
42+
<code/>
43+
</problem>
44+
<problem file="lib/javascript-static.js" linefrom="9" lineto="9" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/lib/javascript-static.js#L9" ruleset="eslint" rule="rules.semi" url="https://docs.moodle.org/dev/Javascript/Coding_style" type="error" weight="5">
45+
<message>Missing semicolon. (semi)</message>
46+
<description/>
47+
<code/>
48+
</problem>
49+
<problem file="lib/yui/src/tooltip/js/tooltip.js" linefrom="16" lineto="16" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/lib/yui/src/tooltip/js/tooltip.js#L16" ruleset="eslint" rule="rules.semi" url="https://docs.moodle.org/dev/Javascript/Coding_style" type="error" weight="5">
50+
<message>Missing semicolon. (semi)</message>
51+
<description/>
52+
<code/>
53+
</problem>
54+
</mess>
55+
</check>
56+
<check id="css" title="CSS problems" url="https://docs.moodle.org/dev/CSS_coding_style" numerrors="0" numwarnings="0" allowfiltering="1">
57+
<description>This section shows CSS problems detected by stylelint</description>
58+
<mess/>
59+
</check>
2360
<check id="phpdoc" title="PHPDocs style problems" url="https://docs.moodle.org/dev/Coding_style" numerrors="0" numwarnings="0" allowfiltering="1">
2461
<description>This section shows the phpdocs problems detected in the code by local_moodlecheck</description>
2562
<mess/>
2663
</check>
2764
<check id="commit" title="Commit messages problems" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" numerrors="3" numwarnings="0" allowfiltering="1">
2865
<description>This section shows the problems detected in the commit messages by the commits checker</description>
2966
<mess>
30-
<problem file="8b0f63da17" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/8b0f63da17" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
67+
<problem file="b7af412184" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/b7af412184" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
3168
<message>The commit message does not begin with the expected issue code MDL-[0-9]{3,6} and a space. </message>
3269
<description/>
3370
<code/>
3471
</problem>
35-
<problem file="536542c7f0" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/536542c7f0" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
72+
<problem file="866e4150c3" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/866e4150c3" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
3673
<message>The commit message does not begin with the expected issue code MDL-[0-9]{3,6} and a space. </message>
3774
<description/>
3875
<code/>
3976
</problem>
40-
<problem file="a9d19ab512" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/a9d19ab512" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
77+
<problem file="60aa3dda7a" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/commit/60aa3dda7a" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Commit_cheat_sheet#Provide_clear_commit_messages" type="error" weight="3">
4178
<message>The commit message does not begin with the expected issue code MDL-[0-9]{3,6} and a space. </message>
4279
<description/>
4380
<code/>
@@ -59,13 +96,13 @@
5996
<check id="grunt" title="grunt changes" url="https://docs.moodle.org/dev/Grunt" numerrors="1" numwarnings="1" allowfiltering="0">
6097
<description>This section shows files built by grunt and not commited</description>
6198
<mess>
62-
<problem file="" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/8b0f63da1743bd175115ea9e07d298dd19500f9b/#L0" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Grunt" type="error" weight="5">
99+
<problem file="" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/#L0" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Grunt" type="error" weight="5">
63100
<message>Problems running grunt</message>
64101
<description/>
65102
<code/>
66103
</problem>
67-
<problem file="" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/8b0f63da1743bd175115ea9e07d298dd19500f9b/#L0" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Grunt" type="warning" weight="1">
68-
<message>Task "jshint:files" failed. Use --force to continue.</message>
104+
<problem file="" linefrom="0" lineto="0" method="" class="" package="" api="" diffurl="https://git.in.moodle.com/integration/prechecker/blob/b7af412184b8936cb0af859c417a854bd2372f41/#L0" ruleset="moodle" rule="" url="https://docs.moodle.org/dev/Grunt" type="warning" weight="1">
105+
<message>Task "eslint:amd" failed. Use --force to continue.</message>
69106
<description/>
70107
<code/>
71108
</problem>
@@ -79,4 +116,8 @@
79116
<description>This section shows problems detected in mustache templates</description>
80117
<mess/>
81118
</check>
119+
<check id="gherkin" title="Gherkin .feature problems" url="https://docs.moodle.org/dev/Writing_acceptance_tests" numerrors="0" numwarnings="0" allowfiltering="1">
120+
<description>This section shows problems detected in behat .feature files</description>
121+
<mess/>
122+
</check>
82123
</smurf>

0 commit comments

Comments
 (0)