Skip to content

Commit

Permalink
Add new semantic version integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
configcat-developer committed Dec 24, 2019
1 parent 9d57c6e commit 1af26e1
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 2 deletions.
1 change: 1 addition & 0 deletions DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
```bash
go test
```
3. Bump the version in `version.go`
## Publish
- Via git tag
1. Create a new version tag.
Expand Down
95 changes: 95 additions & 0 deletions resources/testmatrix_semantic_2.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Identifier;Email;Country;AppVersion;precedenceTests
dontcare;;;1.9.1-1;< 1.9.1-2
dontcare;;;1.9.1-2;< 1.9.1-10
dontcare;;;1.9.1-10;< 1.9.1-10a
dontcare;;;1.9.1-10a;< 1.9.1-1a
dontcare;;;1.9.1-1a;< 1.9.1-alpha
dontcare;;;1.9.1-alpha;< 1.9.99-alpha
dontcare;;;1.9.99-alpha;= 1.9.99-alpha
dontcare;;;1.9.99-alpha+build1;= 1.9.99-alpha
dontcare;;;1.9.99-alpha+build2;= 1.9.99-alpha
dontcare;;;1.9.99-alpha2;< 1.9.99-beta
dontcare;;;1.9.99-beta;< 1.9.99-rc
dontcare;;;1.9.99-rc;< 1.9.99-rc.1
dontcare;;;1.9.99-rc.1;< 1.9.99-rc.2
dontcare;;;1.9.99-rc.2;< 1.9.99-rc.20
dontcare;;;1.9.99-rc.9;< 1.9.99-rc.20
dontcare;;;1.9.99-rc.20;< 1.9.99-rc.20a
dontcare;;;1.9.99-rc.20a;< 1.9.99-rc.2a
dontcare;;;1.9.99-rc.2a;< 1.9.99
dontcare;;;1.9.99;< 1.9.100
dontcare;;;1.9.100;< 1.10.0-alpha
dontcare;;;1.10.0-alpha;<= 1.10.0-alpha
dontcare;;;1.10.0;<= 1.10.0
dontcare;;;1.10.1;<= 1.10.1
dontcare;;;1.10.2;<= 1.10.3
dontcare;;;2.0.0;= 2.0.0
dontcare;;;2.0.0+build3;= 2.0.0
dontcare;;;2.0.0+001;= 2.0.0
dontcare;;;2.0.0+20130313144700;= 2.0.0
dontcare;;;2.0.0+exp.sha.5114f85;= 2.0.0
dontcare;;;3.0.0;= 3.0.0+build3
dontcare;;;4.0.0;= 4.0.0+001
dontcare;;;5.0.0;= 5.0.0+20130313144700
dontcare;;;6.0.0;= 6.0.0+exp.sha.5114f85
dontcare;;;7.0.0-patch+metadata;= 7.0.0-patch
dontcare;;;8.0.0-patch+metadata;= 8.0.0-patch+anothermetadata
dontcare;;;9.0.0-patch;= 9.0.0-patch+metadata
dontcare;;;10.0.0;DEFAULT-FROM-CC-APP
dontcare;;;104.0.0;> 103.0.0
dontcare;;;103.0.0;>= 103.0.0
dontcare;;;102.0.0;>= 101.0.0
dontcare;;;101.0.0;>= 101.0.0
dontcare;;;90.104.0;> 90.103.0
dontcare;;;90.103.0;>= 90.103.0
dontcare;;;90.102.0;>= 90.101.0
dontcare;;;90.101.0;>= 90.101.0
dontcare;;;80.0.104;> 80.0.103
dontcare;;;80.0.103;>= 80.0.103
dontcare;;;80.0.102;>= 80.0.101
dontcare;;;80.0.101;>= 80.0.101
dontcare;;;73.0.0;>= 73.0.0-beta.2
dontcare;;;72.0.0;> 72.0.0-beta.2
dontcare;;;72.0.0-beta.2;> 72.0.0-beta.1
dontcare;;;72.0.0-beta.1;> 72.0.0-beta
dontcare;;;72.0.0-beta;> 72.0.0-alpha
dontcare;;;72.0.0-alpha;> 72.0.0-1a
dontcare;;;72.0.0-1a;> 72.0.0-10a
dontcare;;;72.0.0-10aa;> 72.0.0-10a
dontcare;;;72.0.0-10a;> 72.0.0-2
dontcare;;;72.0.0-2;> 72.0.0-1
dontcare;;;71.0.0+metadata;>= 71.0.0+anothermetadata
dontcare;;;71.0.0-patch3+metadata;>= 71.0.0-patch3+anothermetadata
dontcare;;;71.0.0-patch2+metadata;>= 71.0.0-patch2
dontcare;;;71.0.0-patch1;>= 71.0.0-patch1+metadata
dontcare;;;60.73.0;>= 60.73.0-beta.2
dontcare;;;60.72.0;> 60.72.0-beta.2
dontcare;;;60.72.0-beta.2;> 60.72.0-beta.1
dontcare;;;60.72.0-beta.1;> 60.72.0-beta
dontcare;;;60.72.0-beta;> 60.72.0-alpha
dontcare;;;60.72.0-alpha;> 60.72.0-1a
dontcare;;;60.72.0-1a;> 60.72.0-10a
dontcare;;;60.72.0-10aa;> 60.72.0-10a
dontcare;;;60.72.0-10a;> 60.72.0-2
dontcare;;;60.72.0-2;> 60.72.0-1
dontcare;;;60.71.0+metadata;>= 60.71.0+anothermetadata
dontcare;;;60.71.0-patch3+metadata;>= 60.71.0-patch3+anothermetadata
dontcare;;;60.71.0-patch2+metadata;>= 60.71.0-patch2
dontcare;;;60.71.0-patch1;>= 60.71.0-patch1+metadata
dontcare;;;50.60.73;>= 50.60.73-beta.2
dontcare;;;50.60.72;> 50.60.72-beta.2
dontcare;;;50.60.72-beta.2;> 50.60.72-beta.1
dontcare;;;50.60.72-beta.1;> 50.60.72-beta
dontcare;;;50.60.72-beta;> 50.60.72-alpha
dontcare;;;50.60.72-alpha;> 50.60.72-1a
dontcare;;;50.60.72-1a;> 50.60.72-10a
dontcare;;;50.60.72-10aa;> 50.60.72-10a
dontcare;;;50.60.72-10a;> 50.60.72-2
dontcare;;;50.60.72-2;> 50.60.72-1
dontcare;;;50.60.71+metadata;>= 50.60.71+anothermetadata
dontcare;;;50.60.71-patch3+metadata;>= 50.60.71-patch3+anothermetadata
dontcare;;;50.60.71-patch2+metadata;>= 50.60.71-patch2
dontcare;;;50.60.71-patch1;>= 50.60.71-patch1+metadata
dontcare;;;50.60.71-patch1+anothermetadata;>= 50.60.71-patch1+metadata
dontcare;;;40.0.0-patch;>= 40.0.0-patch
dontcare;;;30.0.0-beta;>= 30.0.0-alpha
4 changes: 3 additions & 1 deletion rollout_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func TestRolloutIntegration(t *testing.T) {
doIntegrationTest("PKDVCLf-Hq-h-kCzMp-L7Q/psuH7BGHoUmdONrzzUOY7A", "testmatrix.csv", t)
doIntegrationTest("PKDVCLf-Hq-h-kCzMp-L7Q/BAr3KgLTP0ObzKnBTo5nhA", "testmatrix_semantic.csv", t)
doIntegrationTest("PKDVCLf-Hq-h-kCzMp-L7Q/uGyK3q9_ckmdxRyI7vjwCw", "testmatrix_number.csv", t)
doIntegrationTest("PKDVCLf-Hq-h-kCzMp-L7Q/q6jMCFIp-EmuAfnmZhPY7w", "testmatrix_semantic_2.csv", t)
}

func doIntegrationTest(apiKey string, fileName string, t *testing.T) {
Expand All @@ -32,6 +33,7 @@ func doIntegrationTest(apiKey string, fileName string, t *testing.T) {

header, _ := reader.Read()
settingKeys := header[4:]
customKey := header[3]

var errors []string

Expand Down Expand Up @@ -60,7 +62,7 @@ func doIntegrationTest(apiKey string, fileName string, t *testing.T) {

custom := map[string]string{}
if len(line[3]) > 0 && line[3] != "##null##" {
custom["Custom1"] = line[3]
custom[customKey] = line[3]
}

user = NewUserWithAdditionalAttributes(identifier, email, country, custom)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package configcat

const (
version = "1.1"
version = "2.1"
)

0 comments on commit 1af26e1

Please sign in to comment.