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. # A web API for a description of all the combined rules from watched banlists.
# GET /api/1/ruleserver/updates # GET /api/1/ruleserver/updates
ruleServer: 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 () { describe("Test: that policy lists are consumed by the associated synapse module", function () {
this.afterEach(async function () { this.afterEach(async function () {
this.timeout(5000) if(config.web.ruleServer.enabled) {
LogService.debug('policyConsumptionTest', `Rules at end of test ${JSON.stringify(await currentRules(), null, 2)}`); this.timeout(5000)
const mjolnir = config.RUNTIME.client!; LogService.debug('policyConsumptionTest', `Rules at end of test ${JSON.stringify(await currentRules(), null, 2)}`);
// Clear any state associated with the account. const mjolnir = config.RUNTIME.client!;
await mjolnir.setAccountData('org.matrix.mjolnir.watched_lists', { // Clear any state associated with the account.
references: [], 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.beforeEach(async function () {
this.timeout(1000); this.timeout(1000);