Skip to content

Commit

Permalink
release 2.8.28 (#2987)
Browse files Browse the repository at this point in the history
* nodeunit -> nodeunit-x (+security updates)
* avoid tests/plugins failures due to timing issues
* bump haraka-net-utils version: fixes #2985
  • Loading branch information
msimerson authored Oct 15, 2021
1 parent 7866546 commit 16b58d2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 34 deletions.
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

## NEXT - 2021-MM-DD


## 2.8.28 - 2021-10-14

### Changes

- breaking: dkim.js has changed the constructor opts
Expand Down Expand Up @@ -113,6 +116,7 @@
* TLS: don't abort loading certs in config/tls dir when an error is encountered. Process every cert file and then emit errors. #2729
* restore TLS version, correctly #2723


## 2.8.25 - 2019-10-11

### Changes
Expand Down
6 changes: 3 additions & 3 deletions contrib/plugin2npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if [ -f "tests/plugins/$1.js" ]; then
#!/usr/bin/env node
'use strict'
try {
var reporter = require('nodeunit').reporters.default;
var reporter = require('nodeunit-x').reporters.default;
}
catch (e) {
console.log(`
Expand All @@ -102,8 +102,8 @@ reporter.run([ 'test' ], undefined, (err) => {
EO_TEST_RUN

sed -i '' \
-e 's/"_mocha"/"nodeunit"/' \
-e 's/"mocha"/"nodeunit"/' \
-e 's/"_mocha"/"nodeunit-x"/' \
-e 's/"mocha"/"nodeunit-x"/' \
"$PLUGIN_REPO/package.json"

$GIT_CMD add package.json
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/queue/smtp_forward.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ forwarding for specific domains.

# Split host forward routing

When an incoming email transaction has multiple recipients with different forward routes, recipients to subsequent forward routes are deferred. Example: an incoming email transaction has recipients [email protected], [email protected], and [email protected]. The first two messages will be accepted (they share the same forward destination) and the latter one will be deferred. It will arrive in a future delivery attempt by the remote.
When an incoming email transaction has multiple recipients with different forward routes, recipients to subsequent forward routes are deferred. Example: an incoming email transaction has recipients [email protected], [email protected], and [email protected]. The first two recipients will be accepted (they share the same forward destination) and the latter will be deferred. It will arrive in a future delivery attempt by the remote.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"server",
"email"
],
"version": "2.8.27",
"version": "2.8.28",
"homepage": "http://haraka.github.io",
"repository": {
"type": "git",
Expand All @@ -36,7 +36,7 @@
"haraka-config" : "^1.0.20",
"haraka-constants" : "^1.0.5",
"haraka-dsn" : "^1.0.3",
"haraka-net-utils" : "^1.3.0",
"haraka-net-utils" : "^1.3.1",
"haraka-notes" : "^1.0.4",
"haraka-plugin-redis" : "^1.0.12",
"haraka-results" : "^2.0.3",
Expand Down Expand Up @@ -69,7 +69,7 @@
"tmp" : "~0.2.1"
},
"devDependencies": {
"nodeunit" : "^0.11",
"nodeunit-x" : "^0.15.0",
"haraka-test-fixtures" : "^1.0.33",
"mock-require" : "^3.0.3",
"eslint" : "^8.0",
Expand Down
5 changes: 3 additions & 2 deletions run_tests
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env node

"use strict";
'use strict';

let reporter;
try {
reporter = require('nodeunit').reporters.default;
reporter = require('nodeunit-x').reporters.default;
}
catch (e) {
console.log(`Error: ${e.message}
Expand Down
49 changes: 24 additions & 25 deletions tests/plugins.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict';

process.env.WITHOUT_CONFIG_CACHE=true;

const fs = require('fs');
const path = require('path');
const plugin = require('../plugins');
Expand Down Expand Up @@ -46,46 +48,43 @@ exports.plugin = {
}
}

const toPath = path.join('config', `${piName }.timeout`);

const toVals = [ '0', '3', '60', 'apple'];
function getVal () {
return toVals.shift();
}
const toPath = path.join('config', `${piName}.timeout`);

exports.get_timeout = {
setUp (done) {
process.env.WITHOUT_CONFIG_CACHE=true;
this.to = getVal();
const self = this;
fs.writeFile(toPath, this.to, () => {
self.plugin = new plugin.Plugin(piName);
done();
});
},
tearDown : done => {
delete process.env.WITHOUT_CONFIG_CACHE;
fs.unlink(toPath, done);
},
'0s' (test) {
test.expect(1);
test.equal( this.plugin.timeout, this.to );
test.done();
fs.writeFile(toPath, '0', () => {
this.plugin = new plugin.Plugin(piName);
test.equal( this.plugin.timeout, 0 );
test.done();
})
},
'3s' (test) {
test.expect(1);
test.equal( this.plugin.timeout, this.to );
test.done();
fs.writeFile(toPath, '3', () => {
this.plugin = new plugin.Plugin(piName);
test.equal( this.plugin.timeout, 3 );
test.done();
})
},
'60s' (test) {
test.expect(1);
test.equal( this.plugin.timeout, this.to );
test.done();
fs.writeFile(toPath, '60', () => {
this.plugin = new plugin.Plugin(piName);
test.equal( this.plugin.timeout, 60 );
test.done();
})
},
'30s default (overrides NaN apple)' (test) {
'30s default (overrides NaN)' (test) {
test.expect(1);
test.equal( this.plugin.timeout, 30 );
test.done();
fs.writeFile(toPath, 'apple', () => {
this.plugin = new plugin.Plugin(piName);
test.equal( this.plugin.timeout, 30 );
test.done();
})
},
}

Expand Down

0 comments on commit 16b58d2

Please sign in to comment.