mirror of
https://github.com/passbolt/go-passbolt.git
synced 2025-05-12 10:48:20 +00:00
Compare commits
4 commits
b919c3e09d
...
7a23a1aeea
Author | SHA1 | Date | |
---|---|---|---|
7a23a1aeea | |||
867980552a | |||
eaf92f3d46 | |||
7ede26f1f4 |
3 changed files with 27 additions and 16 deletions
32
.github/workflows/.go.yml
vendored
32
.github/workflows/.go.yml
vendored
|
@ -2,9 +2,9 @@ name: Go
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [main, v5]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [main, v5]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
@ -16,19 +16,19 @@ jobs:
|
||||||
go-version: 1.23
|
go-version: 1.23
|
||||||
- name: "Setup Passbolt"
|
- name: "Setup Passbolt"
|
||||||
run: |
|
run: |
|
||||||
git clone https://github.com/passbolt/passbolt_docker.git ../passbolt_docker
|
git clone https://github.com/passbolt/passbolt_docker.git ../passbolt_docker
|
||||||
cd ../passbolt_docker
|
cd ../passbolt_docker
|
||||||
docker compose -f docker-compose/docker-compose-ce.yaml up -d
|
docker compose -f docker-compose/docker-compose-ce.yaml up -d
|
||||||
docker ps -a
|
docker ps -a
|
||||||
- name: "Test"
|
- name: "Test"
|
||||||
run: |
|
run: |
|
||||||
docker exec docker-compose-passbolt-1 sh -c '/usr/bin/wait-for.sh -t 30 localhost:443'
|
docker exec docker-compose-passbolt-1 sh -c '/usr/bin/wait-for.sh -t 30 localhost:443'
|
||||||
output=$(docker exec docker-compose-passbolt-1 sh -c 'su -m -c "/usr/share/php/passbolt/bin/cake \
|
output=$(docker exec docker-compose-passbolt-1 sh -c 'su -m -c "/usr/share/php/passbolt/bin/cake \
|
||||||
passbolt register_user \
|
passbolt register_user \
|
||||||
-u your@email.com \
|
-u your@email.com \
|
||||||
-f yourname \
|
-f yourname \
|
||||||
-l surname \
|
-l surname \
|
||||||
-r admin" -s /bin/sh www-data')
|
-r admin" -s /bin/sh www-data')
|
||||||
export REG_URL=$(echo ${output##* your mailbox or here: } | tr -d '\n')
|
export REG_URL=$(echo ${output##* your mailbox or here: } | tr -d '\n')
|
||||||
echo "Register with $REG_URL"
|
echo "Register with $REG_URL"
|
||||||
go test -v ./...
|
go test -v ./...
|
||||||
|
|
|
@ -6,6 +6,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestResourceCreate(t *testing.T) {
|
func TestResourceCreate(t *testing.T) {
|
||||||
|
// Skip integration tests if no client is available
|
||||||
|
if client == nil {
|
||||||
|
t.SkipNow()
|
||||||
|
}
|
||||||
id, err := CreateResource(context.TODO(), client, "", "name", "username", "https://url.lan", "password123", "a password description")
|
id, err := CreateResource(context.TODO(), client, "", "name", "username", "https://url.lan", "password123", "a password description")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Creating Resource %v", err)
|
t.Fatalf("Creating Resource %v", err)
|
||||||
|
|
|
@ -15,6 +15,13 @@ var client *api.Client
|
||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
url := os.Getenv("REG_URL")
|
url := os.Getenv("REG_URL")
|
||||||
|
|
||||||
|
// If we don't have a URL for Creating a user, Skip all integration tests by not Providing a client
|
||||||
|
if url == "" {
|
||||||
|
fmt.Println("REG_URL Env Variable Empty, Skipping integration tests")
|
||||||
|
os.Exit(m.Run())
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf("Registering with url: %v\n", url)
|
fmt.Printf("Registering with url: %v\n", url)
|
||||||
userID, token, err := ParseInviteUrl(url)
|
userID, token, err := ParseInviteUrl(url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue