Skip policy consumption test when the rule server is not enabled

This commit is contained in:
gnuxie 2022-01-13 16:54:29 +00:00
parent 4537cf0d8a
commit afb0fd5a23
2 changed files with 16 additions and 8 deletions

View File

@ -190,4 +190,4 @@ web:
# A web API for a description of all the combined rules from watched banlists.
# GET /api/1/ruleserver/updates
ruleServer:
enabled: true
enabled: false

View File

@ -40,13 +40,21 @@ async function waitForRuleChange(thunk): Promise<void> {
describe("Test: that policy lists are consumed by the associated synapse module", function () {
this.afterEach(async function () {
this.timeout(5000)
LogService.debug('policyConsumptionTest', `Rules at end of test ${JSON.stringify(await currentRules(), null, 2)}`);
const mjolnir = config.RUNTIME.client!;
// Clear any state associated with the account.
await mjolnir.setAccountData('org.matrix.mjolnir.watched_lists', {
references: [],
});
if(config.web.ruleServer.enabled) {
this.timeout(5000)
LogService.debug('policyConsumptionTest', `Rules at end of test ${JSON.stringify(await currentRules(), null, 2)}`);
const mjolnir = config.RUNTIME.client!;
// Clear any state associated with the account.
await mjolnir.setAccountData('org.matrix.mjolnir.watched_lists', {
references: [],
});
}
})
this.beforeAll(async function() {
if (!config.web.ruleServer.enabled) {
LogService.warn("policyConsumptionTest", "Skipping policy consumption test because the ruleServer is not enabled")
this.skip();
}
})
this.beforeEach(async function () {
this.timeout(1000);