Skip to content

Commit

Permalink
update test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
dmke committed Nov 2, 2021
1 parent 0cd6499 commit 3aabc94
Show file tree
Hide file tree
Showing 4 changed files with 1,839 additions and 124 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ install: $(DEPS)
clean:
rm -f mattercheck
rm -rf dist

.PHONY: update-fixture
update-fixture:
curl -sSLo releases/testdata/version-archive.html \
https://docs.mattermost.com/upgrade/version-archive.html
4 changes: 2 additions & 2 deletions releases/releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
)

// TODO: a JSON feed would be nice (https://github.com/mattermost/docs/issues/1190#issuecomment-302162095)
const releasesURL = "https://docs.mattermost.com/administration/version-archive.html"
const releasesURL = "https://docs.mattermost.com/upgrade/version-archive.html"

var (
absEnt = xmlpath.MustCompile(`//div[@id='mattermost-enterprise-edition']/dl/dt`)
absTeam = xmlpath.MustCompile(`//div[@id='mattermost-team-edition-server-archive']/dl/dt`)
absTeam = xmlpath.MustCompile(`//div[@id='mattermost-team-edition']/dl/dt`)

relChangeLog = xmlpath.MustCompile(`./a[1]/@href`)
relDownload = xmlpath.MustCompile(`./a[2]/@href`)
Expand Down
8 changes: 4 additions & 4 deletions releases/releases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ func init() {

const (
// Latest version found in testdata/version-archive.html.
fixtureVersion = "5.35.1"
fixtureVersion = "6.0.2"

// The corresponding SHA256 checksums.
entChecksum = "dbadcafba3f9b6c5af030b6701d8edbb048df39bc94567fbf900865eed6d53b7"
teamChecksum = "45a0b34e7f32948da6f2a1e1e3862b967f728bb962d9bc74b07b5868d6882ccf"
entChecksum = "4580a435a350c9401d50972e720a47e2551eba889a51b976991c6b906a2ac1fd"
teamChecksum = "56a2148e8cac5c40ac700fed4cd52c875c512fa0dce5e54f1414af7513f0cb8e"
)

func TestFindLatestTeamRelease(t *testing.T) {
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestUpdateCandidate(t *testing.T) {
"4.2.0",
"5.31.0",
fixtureVersion,
"6.0.0",
"99.0.0",
} {
current := current
t.Run(current+"/ent", func(t *testing.T) {
Expand Down
Loading

0 comments on commit 3aabc94

Please sign in to comment.