Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WiP] Add OCM-test-suite #51

Merged
merged 45 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7ddef74
style: pad backslashes
MahdiBaghbani Oct 27, 2023
74f82a9
add: initial ocm test suite
MahdiBaghbani Oct 27, 2023
24383dd
fix: rm flags
MahdiBaghbani Oct 27, 2023
92a874e
fix: vnc server display width and height
MahdiBaghbani Oct 27, 2023
c2f33f1
add: act
MahdiBaghbani Nov 24, 2023
08f418e
add: act to path
MahdiBaghbani Nov 24, 2023
821d83d
add: basic workflow
MahdiBaghbani Nov 24, 2023
0c4d1e2
modify: workflow trigger to manual call
MahdiBaghbani Nov 24, 2023
c80a12f
add: bin directory and act to path
MahdiBaghbani Nov 24, 2023
fe18273
add: docs about act
MahdiBaghbani Nov 24, 2023
561bebc
modify: use workflow_dispatch event
MahdiBaghbani Nov 24, 2023
57db613
add: basic cypress workflow
MahdiBaghbani Nov 24, 2023
b7a3007
modify: cypress resolution
MahdiBaghbani Nov 26, 2023
9045d69
add: cypress login tests for nc and oc
MahdiBaghbani Nov 26, 2023
60147eb
rename: cypress tests
MahdiBaghbani Nov 27, 2023
2cbc3ce
fix: typo
MahdiBaghbani Nov 27, 2023
79da585
add: initial federatec share flow test
MahdiBaghbani Nov 30, 2023
b18a27b
modify: downgrade cypress version to avoid https://github.com/cypress…
MahdiBaghbani Dec 5, 2023
369e892
remove: trusting certs in cypress, doesn't needed it
MahdiBaghbani Dec 5, 2023
375a813
add: initial ci testing script
MahdiBaghbani Dec 5, 2023
ef49384
add: ocm test suite for chrome
MahdiBaghbani Dec 5, 2023
00955d4
add: pull images used by ci runner
MahdiBaghbani Dec 5, 2023
d2107b6
add: temporary on push
MahdiBaghbani Dec 5, 2023
46801ac
fix: github actions by adding -t flag to docker run
MahdiBaghbani Dec 5, 2023
4e1d726
remove: github actions on push
MahdiBaghbani Dec 5, 2023
a9273c6
revert: adding -t flag to docker
MahdiBaghbani Dec 5, 2023
7e027e6
add: dedicated ci script for init deps whitout -it flag for docker
MahdiBaghbani Dec 5, 2023
8e34a06
add: some comments
MahdiBaghbani Dec 5, 2023
09d9960
add: -t flag (I'm being clowned by GitHub)
MahdiBaghbani Dec 5, 2023
ae8d239
fix: branch name typo, we have main not master
MahdiBaghbani Dec 5, 2023
9421f7b
add: patched composer file
MahdiBaghbani Dec 5, 2023
83706aa
modify: use pacthed makefile to avoid tty error
MahdiBaghbani Dec 5, 2023
5ac799e
revert: sm patch, patched the source
MahdiBaghbani Dec 5, 2023
2ed0a8e
fix: typo in script path
MahdiBaghbani Dec 5, 2023
c373d29
remove: docker -t flags
MahdiBaghbani Dec 5, 2023
08b50b0
add: temporary sciencmesh conf to disable collabora
MahdiBaghbani Dec 5, 2023
5fa80b6
remove: collabora and remove unused docker mounts
MahdiBaghbani Dec 5, 2023
11f6643
add: other browsers to workflow
MahdiBaghbani Dec 5, 2023
fb50ff1
rename: temporary disable fed shares tests for first milestone
MahdiBaghbani Dec 5, 2023
fc7c89c
remove: we no longer need this
MahdiBaghbani Dec 5, 2023
dac8a29
add: cypress record
MahdiBaghbani Dec 5, 2023
4d2aced
add: github workflow upload video of tests
MahdiBaghbani Dec 5, 2023
6027ac2
add: ignore cypress videos folder
MahdiBaghbani Dec 5, 2023
7c0e886
update: upload-artifacts to version 3
MahdiBaghbani Dec 5, 2023
03a4668
Merge pull request #55 from pondersource/ocm-mahdi-edition
MahdiBaghbani Dec 6, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Basic workflow for testing GitHub Actions and act.

on:
workflow_dispatch

jobs:
basic:
runs-on: ubuntu-22.04
steps:
- name: Hello, World!
run: echo "Hello, World!"
105 changes: 105 additions & 0 deletions .github/workflows/ocm-test-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: ocm-test-suite
run-name: Open Cloud Mesh Test Suite

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the specified branch
push:
branches:
- main
pull_request:
branches:
- main
- ocm

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
chrome:
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4

- name: Pull images
shell: bash
run: ./ci/ocm-test-suite-pull-images.sh

- name: Initalize OCM tests dependencies
shell: bash
run: ./ci/ocm-test-suite-init-deps.sh

- name: Run tests
shell: bash
run: ./ci/ocm-test-suite.sh chrome

edge:
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4

- name: Pull images
shell: bash
run: ./ci/ocm-test-suite-pull-images.sh

- name: Initalize OCM tests dependencies
shell: bash
run: ./ci/ocm-test-suite-init-deps.sh

- name: Run tests
shell: bash
run: ./ci/ocm-test-suite.sh edge

firefox:
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4

- name: Pull images
shell: bash
run: ./ci/ocm-test-suite-pull-images.sh

- name: Initalize OCM tests dependencies
shell: bash
run: ./ci/ocm-test-suite-init-deps.sh

- name: Run tests
shell: bash
run: ./ci/ocm-test-suite.sh firefox

electron:
runs-on: ubuntu-22.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v4

- name: Pull images
shell: bash
run: ./ci/ocm-test-suite-pull-images.sh

- name: Initalize OCM tests dependencies
shell: bash
run: ./ci/ocm-test-suite-init-deps.sh

- name: Run tests
shell: bash
run: ./ci/ocm-test-suite.sh electron

# Test run video was always captured, so this action uses "always()" condition
- name: Upload Cypress video artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: ./cypress/ocm-tests/cypress/videos
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ rd-sram-integration
oc-sciencemesh-release
nc-sciencemesh-release
surf-token-based-access
cypress/ocm-tests/cypress/videos/*
9 changes: 9 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
FROM gitpod/workspace-full:latest

RUN sudo install-packages php-xdebug

# add binary directory to path.
ENV PATH="/workspace/dev-stock/bin:${PATH}"

# initialize act rc with medium images.
RUN echo "-P ubuntu-latest=catthehacker/ubuntu:act-latest" >> /home/gitpod/.actrc
RUN echo "-P ubuntu-22.04=catthehacker/ubuntu:act-22.04" >> /home/gitpod/.actrc
RUN echo "-P ubuntu-20.04=catthehacker/ubuntu:act-20.04" >> /home/gitpod/.actrc
RUN echo "-P ubuntu-18.04=catthehacker/ubuntu:act-18.04" >> /home/gitpod/.actrc
Binary file added bin/act
Binary file not shown.
99 changes: 99 additions & 0 deletions ci/ocm-test-suite-init-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#!/usr/bin/env bash

# @michielbdejong halt on error in docker init scripts
set -e

# find this scripts location.
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
SOURCE=$(readlink "$SOURCE")
# if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )

cd "$DIR/.." || exit

# repositories and branches.
REPO_NEXTCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh
BRANCH_NEXTCLOUD_APP=nextcloud

REPO_NEXTCLOUD=https://github.com/nextcloud/server
BRANCH_NEXTCLOUD=master

REPO_OWNCLOUD=https://github.com/owncloud/core
BRANCH_OWNCLOUD=v10.13.0

REPO_OWNCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh
BRANCH_OWNCLOUD_APP=owncloud

REPO_REVA=https://github.com/cs3org/reva
BRANCH_REVA=v1.26.0

# Nextcloud source code.
[ ! -d "nextcloud" ] && \
git clone \
--depth 1 \
--branch ${BRANCH_NEXTCLOUD} \
${REPO_NEXTCLOUD} \
nextcloud

# Nextcloud Sciencemesh source code.
[ ! -d "nextcloud-sciencemesh" ] && \
git clone \
--branch ${BRANCH_NEXTCLOUD_APP} \
${REPO_NEXTCLOUD_APP} \
nextcloud-sciencemesh \
&& \
docker run --rm \
-v "$(pwd)/nextcloud-sciencemesh:/var/www/html/apps/sciencemesh" \
--workdir /var/www/html/apps/sciencemesh \
pondersource/dev-stock-nextcloud-sciencemesh \
make composer

# move app to its place inside efss and create symbolic links
[ ! -d "nextcloud/apps/sciencemesh" ] && \
mv nextcloud-sciencemesh nextcloud/apps/sciencemesh

# ownCloud source code.
[ ! -d "owncloud" ] && \
git clone \
--depth 1 \
--branch ${BRANCH_OWNCLOUD} \
${REPO_OWNCLOUD} \
owncloud

# ownCloud Sciencemesh source code.
[ ! -d "owncloud-sciencemesh" ] && \
git clone \
--branch ${BRANCH_OWNCLOUD_APP} \
${REPO_OWNCLOUD_APP} \
owncloud-sciencemesh \
&& \
docker run --rm \
-v "$(pwd)/owncloud-sciencemesh:/var/www/html/apps/sciencemesh" \
--workdir /var/www/html/apps/sciencemesh \
pondersource/dev-stock-owncloud-sciencemesh \
composer install

[ ! -d "owncloud/apps/sciencemesh" ] && \
mv owncloud-sciencemesh owncloud/apps/sciencemesh

# Reva source code.
[ ! -d "reva" ] && \
git clone \
--depth 1 \
--branch ${BRANCH_REVA} \
${REPO_REVA} \
reva \
&& \
docker run --rm \
-v "$(pwd)/reva:/reva-build" \
--workdir /reva-build \
golang:1.21.1-bullseye \
bash -c "git config --global --add safe.directory /reva-build && go mod vendor && make revad"

docker network inspect testnet >/dev/null 2>&1 || docker network create testnet

[ ! -d "temp" ] && mkdir -p temp
13 changes: 13 additions & 0 deletions ci/ocm-test-suite-pull-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# @michielbdejong halt on error in docker init scripts
set -e

docker pull mariadb
docker pull collabora/code:latest
docker pull cypress/included:13.3.0
docker pull cs3org/wopiserver:latest
docker pull pondersource/dev-stock-revad
docker pull pondersource/dev-stock-ocmstub
docker pull pondersource/dev-stock-owncloud-sciencemesh
docker pull pondersource/dev-stock-nextcloud-sciencemesh
Loading