DEV: Add smoke test to github actions (#8580)
This commit is contained in:
parent
c8d438cc63
commit
38b4e3b5a7
|
@ -156,4 +156,3 @@ jobs:
|
|||
if: env.BUILD_TYPE == 'FRONTEND'
|
||||
run: bundle exec rake plugin:qunit
|
||||
timeout-minutes: 30
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
name: SMOKE TEST
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- 'tests-passed'
|
||||
|
||||
jobs:
|
||||
smoke_test:
|
||||
name: "CORE"
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install unbuffer
|
||||
run: sudo apt-get install -yqq expect
|
||||
|
||||
- name: Boot dev image
|
||||
run: unbuffer d/boot_dev
|
||||
|
||||
- name: Create script
|
||||
run: |
|
||||
mkdir tmp
|
||||
touch tmp/script.rb
|
||||
echo "u = User.new(username:'smoke_user', password:'P4ssw0rd', email:'smoke@example.com', admin:true)" >> tmp/script.rb
|
||||
echo "u.save!(validate: false)" >> tmp/script.rb
|
||||
echo "u.activate" >> tmp/script.rb
|
||||
echo "SiteSetting.wizard_enabled = false" >> tmp/script.rb
|
||||
|
||||
- name: tmp
|
||||
run: sudo chown -R 1000:1000 .
|
||||
|
||||
- name: Bundle
|
||||
run: unbuffer d/bundle install
|
||||
|
||||
- name: Migrate
|
||||
run: unbuffer d/rake db:migrate
|
||||
|
||||
- name: Run script
|
||||
run: unbuffer d/rails runner tmp/script.rb
|
||||
|
||||
- name: Start Server
|
||||
run: unbuffer d/rails s &
|
||||
|
||||
- name: Warm Up Server
|
||||
run: curl -I -A "Chrome" --retry 10 --retry-delay 1 --max-time 60 http://localhost:3000
|
||||
|
||||
- name: Run smoke test
|
||||
run: unbuffer d/rake smoke:test
|
||||
|
||||
- uses: actions/upload-artifact@v1
|
||||
if: failure()
|
||||
with:
|
||||
name: smoke-test-screenshots
|
||||
path: tmp/smoke-test-screenshots
|
||||
|
|
@ -126,7 +126,7 @@ const path = require("path");
|
|||
});
|
||||
|
||||
await exec("expect a log in button in the header", () => {
|
||||
return page.waitForSelector("header .login-button", { visible: true });
|
||||
return page.waitForSelector("header .login-button");
|
||||
});
|
||||
|
||||
if (process.env.LOGIN_AT_BEGINNING) {
|
||||
|
@ -171,7 +171,9 @@ const path = require("path");
|
|||
}
|
||||
|
||||
await exec("go home", () => {
|
||||
let promise = page.waitForSelector("#site-logo, #site-text-logo", { visible: true });
|
||||
let promise = page.waitForSelector("#site-logo, #site-text-logo", {
|
||||
visible: true
|
||||
});
|
||||
|
||||
promise = promise.then(() => {
|
||||
return page.click("#site-logo, #site-text-logo");
|
||||
|
|
Loading…
Reference in New Issue