Skip to content

Commit

Permalink
Merge branch 'develop' into SS-582-user-guide-images
Browse files Browse the repository at this point in the history
  • Loading branch information
sandstromviktor authored Oct 25, 2023
2 parents 656f343 + 1c766d9 commit a283619
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
working-directory: .

steps:
- name: Workflow Telemetry
uses: runforesight/[email protected]

- name: Branch or tag that triggered the workflow run
run: |
echo "Running on branch ${GITHUB_REF##*/}"
Expand All @@ -44,20 +47,21 @@ jobs:
- name: Prepare repository
run: |
echo "Running as UID: $UID, GID: $GID"
export GID=1000
export GID=127
echo "Now running as UID: $UID, GID: $GID"
whoami
pwd
mv .env.template .env
sudo chgrp -R 1000 media
sudo chgrp -R 127 media
sudo chmod -R g+rwx media
ls -al
echo -e "UID=1001\nGID=127" > .env
- name: A job to install MicroK8s
uses: balchua/[email protected]
with:
channel: '1.26/stable'
addons: '["dns", "rbac", "hostpath-storage", "registry"]'
channel: '1.28/stable'
addons: '["dns", "rbac", "hostpath-storage", "ingress", "helm"]'

- name: Test and config MicroK8s
run: |
Expand All @@ -67,12 +71,14 @@ jobs:
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
sudo microk8s config >> ~/.kube/config
helm
- name: Dump config
working-directory: ${{env.working-directory}}
run: |
sudo microk8s config > cluster.conf
ls -la
cat cluster.conf
- name: Start serve
working-directory: ${{env.working-directory}}
Expand All @@ -89,10 +95,6 @@ jobs:
STUDIO_URL=`awk -F '= ' -v replace="'" '/STUDIO_URL/{gsub(replace, "", $NF); print $NF}' studio/settings.py`
echo "STUDIO_URL=$STUDIO_URL" >> $GITHUB_ENV
echo "The Serve URL is $STUDIO_URL"
docker exec studio pwd
docker exec studio ls -al
docker exec studio whoami
docker exec studio id stackn
- name: Check URL is up
uses: gerdemann/[email protected]
Expand All @@ -111,16 +113,17 @@ jobs:
response=$(curl --write-out '%{http_code}' --silent --output /dev/null ${{ env.STUDIO_URL }})
if [[ "$response" -ne 200 ]] ; then echo "status $response" && sleep 30; else echo "serve is ready"; fi
- name: Check if celery worker can access kubectl
- name: Check if celery worker can access kubectl and helm
run: |
docker exec celery-worker kubectl get po
docker exec celery-worker kubectl version
docker exec celery-worker helm version
- name: Cypress run e2e tests
uses: cypress-io/github-action@v5
with:
working-directory: ${{env.working-directory}}
config: pageLoadTimeout=100000,baseUrl=${{ env.STUDIO_URL }}
browser: chrome
quiet: true
- name: Save cypress screenshot artifacts on failure
uses: actions/upload-artifact@v3
Expand All @@ -134,3 +137,11 @@ jobs:
with:
name: cypress-videos
path: cypress/videos

- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
## If no one connects after 2 minutes, shut down server.
wait-timeout-minutes: 2


8 changes: 4 additions & 4 deletions cypress/e2e/ui-tests/test-deploy-app.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ describe("Test deploying app", () => {
cy.get('input[name="appconfig.path"]').clear().type("/home")
cy.get('button').contains('Create').click()

// TODO: debug problems with status not set to Running
//cy.get('tr:contains("' + app_name_private + '")').find('span').should('contain', 'Running')
cy.wait(30000)
cy.get('tr:contains("' + app_name_private + '")').find('span').should('contain', 'Running')

cy.get('tr:contains("' + app_name_private + '")').find('i.bi-three-dots-vertical').click()
cy.get('tr:contains("' + app_name_private + '")').find('a.confirm-delete').click()
Expand All @@ -85,8 +85,8 @@ describe("Test deploying app", () => {
cy.get('input[name="appconfig.path"]').clear().type("/home")
cy.get('button').contains('Create').click()

// TODO: debug problems with status not set to Running
//cy.get('tr:contains("' + app_name_public + '")').find('span').should('contain', 'Running')
cy.wait(5000)
cy.get('tr:contains("' + app_name_public + '")').find('span').should('contain', 'Running')

cy.visit("/apps")
cy.get("title").should("have.text", "Apps | SciLifeLab Serve")
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/ui-tests/test-project-as-contributor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe("Test project contributor user functionality", () => {
})

// This test cannot run properly in GitHub workflows because there is an issue with minio creation there. Therefore, it should be run locally to make sure things work. For GitHub, skipping it.
it.skip("can create a new project with ML serving template, open settings, delete from settings", { defaultCommandTimeout: 100000 }, () => {
it("can create a new project with ML serving template, open settings, delete from settings", { defaultCommandTimeout: 100000 }, () => {

// Names of objects to create
const project_name = "e2e-create-ml-proj-test"
Expand Down
2 changes: 1 addition & 1 deletion fixtures/projects_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@
"model": "projects.projecttemplate",
"pk": 2
}
]
]

0 comments on commit a283619

Please sign in to comment.