Skip to content

Commit

Permalink
Migrate the litmusOcisOldWebdav and the litmusOcisNewWebdav tests fro…
Browse files Browse the repository at this point in the history
…m Drone to GitHub Actions (#3565)
  • Loading branch information
vascoguita authored Dec 20, 2022
1 parent 9bfe2ae commit 6c1f72f
Show file tree
Hide file tree
Showing 43 changed files with 185 additions and 1,437 deletions.
130 changes: 6 additions & 124 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
OC_CI_GOLANG = "owncloudci/golang:1.19"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OSIXIA_OPEN_LDAP = "osixia/openldap:1.3.0"
REDIS = "redis:6-alpine"
OC_CI_PHP = "owncloudci/php:7.4"
OC_LITMUS = "owncloud/litmus:latest"
OC_CS3_API_VALIDATOR = "owncloud/cs3api-validator:0.2.0"
OC_CI_BAZEL_BUILDIFIER = "owncloudci/bazel-buildifier:latest"

def makeStep(target):
def makeStep():
return {
"name": "build",
"image": OC_CI_GOLANG,
"commands": [
"make %s" % target,
"make build",
],
}

Expand Down Expand Up @@ -44,16 +43,6 @@ def ldapService():
},
}

def redisService():
return {
"name": "redis",
"image": REDIS,
"pull": "always",
"environment": {
"REDIS_DATABASES": 1,
},
}

def cephService():
return {
"name": "ceph",
Expand All @@ -80,8 +69,6 @@ def main(ctx):
# implemented for: ocisIntegrationTests and s3ngIntegrationTests
return [
checkStarlark(),
litmusOcisOldWebdav(),
litmusOcisNewWebdav(),
litmusOcisSpacesDav(),
virtualViews(),
] + ocisIntegrationTests(6) + s3ngIntegrationTests(12)
Expand All @@ -104,7 +91,7 @@ def virtualViews():
},
},
"steps": [
makeStep("build-ci"),
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
Expand Down Expand Up @@ -145,111 +132,6 @@ def virtualViews():
],
}

def litmusOcisOldWebdav():
return {
"kind": "pipeline",
"type": "docker",
"name": "litmus-ocis-old-webdav",
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"event": {
"include": [
"pull_request",
"tag",
],
},
},
"steps": [
makeStep("build-ci"),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
"detach": True,
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
],
},
{
"name": "sleep-for-revad-start",
"image": OC_CI_GOLANG,
"commands": [
"sleep 5",
],
},
{
"name": "litmus-ocis-old-webdav",
"image": OC_LITMUS,
"environment": {
"LITMUS_URL": "http://revad-services:20080/remote.php/webdav",
"LITMUS_USERNAME": "einstein",
"LITMUS_PASSWORD": "relativity",
"TESTS": "basic http copymove props",
},
},
],
}

def litmusOcisNewWebdav():
return {
"kind": "pipeline",
"type": "docker",
"name": "litmus-ocis-new-webdav",
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"event": {
"include": [
"pull_request",
"tag",
],
},
},
"steps": [
makeStep("build-ci"),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
"detach": True,
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c storage-home-ocis.toml &",
"/drone/src/cmd/revad/revad -c storage-users-ocis.toml &",
"/drone/src/cmd/revad/revad -c users.toml",
],
},
{
"name": "sleep-for-revad-start",
"image": OC_CI_GOLANG,
"commands": [
"sleep 5",
],
},
{
"name": "litmus-ocis-new-webdav",
"image": OC_LITMUS,
"environment": {
# UUID is einstein user, see https://github.com/owncloud/ocis-accounts/blob/8de0530f31ed5ffb0bbb7f7f3471f87f429cb2ea/pkg/service/v0/service.go#L45
"LITMUS_URL": "http://revad-services:20080/remote.php/dav/files/4c510ada-c86b-4815-8820-42cdf82c3d51",
"LITMUS_USERNAME": "einstein",
"LITMUS_PASSWORD": "relativity",
"TESTS": "basic http copymove props",
},
},
],
}

def litmusOcisSpacesDav():
return {
"kind": "pipeline",
Expand All @@ -268,7 +150,7 @@ def litmusOcisSpacesDav():
},
},
"steps": [
makeStep("build-ci"),
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
Expand Down Expand Up @@ -333,7 +215,7 @@ def ocisIntegrationTests(parallelRuns, skipExceptParts = []):
},
},
"steps": [
makeStep("build-ci"),
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
Expand Down Expand Up @@ -409,7 +291,7 @@ def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):
},
},
"steps": [
makeStep("build-ci"),
makeStep(),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/docker.yml

This file was deleted.

28 changes: 27 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,33 @@ jobs:
run: make dist VERSION=${{ github.ref_name }} GIT_COMMIT=${{ github.sha }} GO_VERSION=$(go version | awk '{print $3}')
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "dist/*"
body_path: "changelog/NOTE.md"
docker:
runs-on: self-hosted
strategy:
matrix:
include:
- tag: ${{ secrets.DOCKERHUB_ORGANIZATION }}/reva:${{ github.ref_name }}
file: Dockerfile.reva
- tag: ${{ secrets.DOCKERHUB_ORGANIZATION }}/revad:${{ github.ref_name }}
file: Dockerfile.revad
- tag: ${{ secrets.DOCKERHUB_ORGANIZATION }}/revad:${{ github.ref_name }}-eos
file: Dockerfile.revad-eos
- tag: ${{ secrets.DOCKERHUB_ORGANIZATION }}/revad:${{ github.ref_name }}-ceph
file: Dockerfile.revad-ceph
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push ${{ matrix.tag }}
uses: docker/build-push-action@v3
with:
push: true
file: docker/${{ matrix.file }}
tags: ${{ matrix.tag }}
45 changes: 44 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test
on: [pull_request, push, workflow_dispatch]

env:
TEST_IMAGE: 'revad:test'

jobs:
test:
runs-on: self-hosted
Expand All @@ -14,7 +17,47 @@ jobs:
- name: Test
run: make test
- name: Test integration
run: make test-integration REDIS_ADDRESS=redis:6379
run: make test-integration
env:
REDIS_ADDRESS: redis:6379
services:
redis:
image: registry.cern.ch/docker.io/webhippie/redis
docker:
runs-on: self-hosted
strategy:
matrix:
image: [reva, revad, revad-eos, revad-ceph]
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image from ${{ matrix.image }}
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile.${{ matrix.image }}
tags: ${{ env.TEST_IMAGE }}
load: ${{ matrix.image == 'revad' }}
- name: Upload ${{ env.TEST_IMAGE }} to artifacts
uses: ishworkh/docker-image-artifact-upload@v1
if: ${{ matrix.image == 'revad' }}
with:
image: ${{ env.TEST_IMAGE }}
retention_days: '1'
litmus:
needs: docker
runs-on: self-hosted
strategy:
matrix:
test: [litmus-1-only, litmus-2-only]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download image
uses: ishworkh/docker-image-artifact-download@v1
with:
image: ${{ env.TEST_IMAGE }}
- name: Test
run: make ${{ matrix.test }}
Loading

0 comments on commit 6c1f72f

Please sign in to comment.