Skip to content

Commit

Permalink
Fix a bunch of snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
queicherius committed Sep 30, 2017
1 parent 88f1636 commit b5102b6
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 32 deletions.
6 changes: 3 additions & 3 deletions worker/__snapshots__/v2_skins.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
"dye_slots": {
"default": [
{
"color_id": 1,
"color_id": 48,
"material": "metal"
},
{
"color_id": 1,
"color_id": 127,
"material": "metal"
},
{
"color_id": 1,
"color_id": 615,
"material": "leather"
},
null
Expand Down
38 changes: 19 additions & 19 deletions worker/__snapshots__/v2_stories_seasons.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,46 @@
"name": "Path of Fire",
"order": 6,
"stories": [
80,
75,
72,
81,
71,
69,
67,
68,
69,
71,
72,
75,
76,
67,
83,
79,
78,
82
79,
80,
81,
82,
83
]
},
{
"id": "215AAA0F-CDAC-4F93-86DA-C155A99B5784",
"name": "My Story",
"order": 1,
"stories": [
8,
2,
10,
9,
1,
2,
3,
7,
3
8,
9,
10
]
},
{
"id": "09766A86-D88D-4DF2-9385-259E9A8CA583",
"name": "Living World Season 3",
"order": 5,
"stories": [
64,
65,
46,
66,
56,
63
63,
64,
65,
66
]
}
]
8 changes: 4 additions & 4 deletions worker/__snapshots__/v2_wvw_objectives.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "Tower",
"map_type": "GreenHome",
"map_id": 1102,
"upgrade_id": 33,
"upgrade_id": 44,
"marker": "https://render.guildwars2.com/file/ABEC80C79576A103EA33EC66FCB99B77291A2F0D/102531.png",
"chat_link": "[&DGgAAABOBAAA]"
},
Expand All @@ -18,9 +18,9 @@
"map_type": "EdgeOfTheMists",
"map_id": 968,
"coord": [
7527.71,
10619.2,
-6189.76
7527.04,
10266.9,
-5915.43
],
"label_coord": [
7481.4,
Expand Down
10 changes: 9 additions & 1 deletion worker/src/endpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,15 @@ const endpoints = [
url:
'/v2/stories/seasons?ids=EAB597C0-C484-4FD3-9430-31433BAC81B6,215AAA0F-CDAC-4F93-86DA-C155A99B5784,09766A86-D88D-4DF2-9385-259E9A8CA583',
matchSnapshot: true,
matchSchema: true
matchSchema: true,
snapshotTransformation: seasons => {
seasons = seasons.map(season => {
season.stories.sort((a, b) => a - b)
return season
})

return seasons
}
},
{
name: '/v2/titles',
Expand Down
8 changes: 5 additions & 3 deletions worker/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ async function runScheduledTests () {

runScheduledTests()

setInterval(() => {
runScheduledTests()
}, 60 * 1000)
if (!process.env.TRAIN && !process.env.TRAIN_MISSING) {
setInterval(() => {
runScheduledTests()
}, 60 * 1000)
}
3 changes: 1 addition & 2 deletions worker/src/matchSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ function matchSchema (endpoint, content) {
// Validate that the schema works
const result = validate(schema, content)
if (!result.valid) {
console.log('Failed training schema for ' + endpoint.name)
console.log(result.errors)
console.log('Failed automatically training schema for ' + endpoint.name)
return {}
}

Expand Down

0 comments on commit b5102b6

Please sign in to comment.