Skip to content

Commit

Permalink
Fix: update src-cli version to latest for tests (#4233)
Browse files Browse the repository at this point in the history
* Update `src-cli` version to latest for tests

* Add bug workaround until patched
  • Loading branch information
jdpleiness authored Mar 20, 2023
1 parent 4e9c6d1 commit 2f9527e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tests/integration/restricted/install-src.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

target_src_version="3.35.1"
target_src_version="5.0.2"
current_src_version=$(src version | grep -i current | sed 's/current version: //i')

if [ "$current_src_version" != "$target_src_version" ]; then
Expand Down
6 changes: 4 additions & 2 deletions tests/integration/restricted/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ CLEANUP="kill $!; $CLEANUP"
sleep 2 # (initial delay in port-forward activating)
curl --retry-connrefused --retry 2 --retry-delay 10 -m 30 http://localhost:30080

/usr/local/bin/src -endpoint http://localhost:30080 version
/usr/local/bin/src version

# run a validation script against it
/usr/local/bin/src -endpoint http://localhost:30080 validate -context github_token=$GH_TOKEN validate.json
# '2>&1' is work around bug where token is output to stderr instead of stdout. Will be patched in 5.0.3 of src-cli
ADMIN_TOKEN=$(/usr/local/bin/src admin create --url http://localhost:30080 --username e2e-test-user --email [email protected] --password 123123123-e2e-test --with-token 2>&1)
SRC_ACCESS_TOKEN=$ADMIN_TOKEN SRC_GITHUB_TOKEN=$GH_TOKEN SRC_ENDPOINT=http://localhost:30080/ /usr/local/bin/src validate install validate.json
36 changes: 16 additions & 20 deletions tests/integration/restricted/validate.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
{
"firstAdmin": {
"email": "[email protected]",
"username": "e2e-test-user",
"password": "123123123-e2e-test"
},
"externalService": {
"config": {
"url": "https://github.com",
"token": "{{ .github_token }}",
"orgs": [],
"repos": [
"sourcegraph-testing/repo-ssh-keys-test"
]
},
"kind": "GITHUB",
"displayName": "footest",
"deleteWhenDone": true
},
"waitRepoCloned": {
"repo": "github.com/sourcegraph-testing/repo-ssh-keys-test",
"maxTries": 10,
"sleepBetweenTriesSeconds": 10
"deleteWhenDone": true,
"maxRetries": 10,
"retryTimeoutSeconds": 10,
"config": {
"gitHub": {
"url": "https://github.com",
"orgs": [],
"repos": [
"sourcegraph-testing/repo-ssh-keys-test"
]
}
}
},
"searchQuery": "repo:^github.com/sourcegraph-testing/repo-ssh-keys-test$ gallery-director-drone-vacant-blizzard"

"searchQuery": [
"repo:^github.com/sourcegraph-testing/repo-ssh-keys-test$ gallery-director-drone-vacant-blizzard"
]
}

0 comments on commit 2f9527e

Please sign in to comment.