-
-
Notifications
You must be signed in to change notification settings - Fork 276
Update testing #1080
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
Merged
Merged
Update testing #1080
Changes from all commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
839deb3
add upgrade pipeline
michield 1824f09
rename pipeline
michield 40f4ebf
add basic 3.6 DB
michield a125c7a
update version
michield 54becd4
Add pipeline for upgrade from 3.6 to 3.7 testing (#1009)
michield cbabebb
update local test setup
michield 72eb575
exclude the behat test tag on CI
michield 9913958
exclude test output
michield c21d4f4
add composer.json
michield d411a93
fix deprecations
michield 4863b53
testing updates
michield 0996420
remove old file
michield e9a2595
add two new feature files
michield 8989c91
ignore .env files
michield c63c95b
add smtp-sink
michield 8c50ff5
Merge branch 'main' into update-testing
michield d05bba9
simplify constructor
michield 6b2b184
add plugin tests
michield b4d0dcc
remove .disabled file
michield 8bc1afe
behat tests update
michield 098f1d1
rename feature file
michield c3963a4
add more tests
michield 1d5d9a8
tidy up
michield 4b9484b
remove database argument
michield 1528af4
set path for files
michield 505cd26
copy screenshots
michield 5a29b0a
set to manually run the queue
michield 93c2f63
Merge branch 'release-3.7' into update-testing
michield 8925093
add smtp-sink
michield 28c3f1e
set pageroot to avoid warning
michield 95cab8a
set pageroot back. stops everything from working
michield b33254e
set some timeouts and add step to refresh the page
michield 4049bca
add refresh the page
michield ad87dd2
Merge branch 'release-3.7.0' into update-testing
michield bddbc49
add php 8.4
michield 0f07768
fix parse errors
michield 55eb57e
mark as WIP
michield 8eed4fb
create directory for screenshots
michield c660625
show progress
michield d49a8cf
remove duplicated action
michield c653960
add REST API
michield 1854b11
lint exclude
tatevikg1 0a863d3
lint update + split
tatevikg1 06d069d
update phplint
michield f3eb24f
upadte matrix values
michield 9c9151b
increase timeouts
michield 16bb0f0
make 8.0 unsupported and 8.3 standard
michield b0a7e5b
add clicking save twice
michield e66bde5
try with firefox to avoid stale element error
michield 785d61f
go back to chrome
michield 29b3a5f
change should see into must see
michield dc147fc
decrease wait time
michield 94f064a
use debug version to enable VNC
michield 860ab69
set pageroot for CI
michield 72df3a9
show the tab panel with the list created
michield 5af687e
remove timeouts from featurecontext, they are in behat.yml already
michield 2c21fe3
the panel is not there
michield 8298296
mark ready
michield 239cabd
remove javascript tag
michield 24fe0b2
remove timeouts, add chrome to local testing
michield 517bd7f
add chrome to local testing
michield caaded0
remove javascript tag
michield 7d7cfc0
remove pageroot setting
michield 1cc60b8
upload log as artifact
michield ba0e62a
mark some failing ones as wip
michield b76851f
makr another wip
michield d856ad1
typo
michield 63b8c9e
don't run all the time
michield 63aa7d1
anoteht typo
michield 717629e
makr another one @wip.
michield 81a59da
create volume to map local code into the container
michield 66c4d4c
give example of env var
michield c1dda24
update README on testing
michield 2a10642
tidy up
michield File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
|
||
name: Upgrade | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['8.1'] | ||
experimental: [false] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }} | ||
|
||
- name: Setup Packages | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
sudo apt update | ||
sudo apt install -y rsync postfix | ||
|
||
# - name: Cache Composer dependencies | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: /tmp/composer-cache | ||
# key: ${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} | ||
|
||
- name: Install dependencies | ||
uses: php-actions/composer@v6 | ||
with: | ||
dev: yes | ||
args: --prefer-dist --no-interaction | ||
php_version: ${{ matrix.php-version }} | ||
php_extensions: xml | ||
version: 2 | ||
|
||
- name: Report Versions and show ENV vars | ||
run: | | ||
google-chrome --version | ||
lsb_release -a | ||
php -v | ||
chromedriver -v | ||
geckodriver -V | ||
which geckodriver | ||
which chromedriver | ||
firefox -v | ||
vendor/bin/behat -V | ||
mysql --version | ||
mysqladmin --version | ||
export | ||
|
||
- name: Create Database | ||
run: | | ||
sudo systemctl start mysql.service | ||
sudo mysql -proot -e 'drop database if exists phplistdb; create database phplistdb;' | ||
sudo mysql -proot -e 'create user phplist@"%" identified by "phplist"; grant all on phplistdb.* to phplist@"%"' | ||
sudo gunzip -c tests/phplist-3.6.sql.gz | sudo mysql -proot phplistdb | ||
|
||
- name: Set bootlist theme | ||
run: | | ||
cd $GITHUB_WORKSPACE/public_html/lists/admin/ui/ | ||
wget https://github.com/phpList/phplist-ui-bootlist/archive/master.tar.gz | ||
tar -xzf master.tar.gz | ||
mv phplist-ui-bootlist-master phplist-ui-bootlist | ||
rm master.tar.gz | ||
|
||
- name: Start Test Server | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
cp -fv tests/ci/behat.yml tests/behat.yml | ||
cp -fv tests/ci/config.php public_html/lists/config/config.php | ||
mkdir -p output/screenshots | ||
touch output/screenshots/README.md | ||
mkdir -p build/mails | ||
smtp-sink -c -d "output/mails/%Y%m%d%H/%M." 2500 1024 & | ||
./bin/start-selenium > output/selenium.log 2>&1 & | ||
sleep 5 | ||
sudo php -S 0.0.0.0:80 -t public_html > /dev/null 2>&1 & | ||
|
||
- name: Check PHP syntax errors | ||
uses: overtrue/phplint@2.4.1 | ||
with: | ||
path: ./public_html | ||
|
||
- name: Upgrade from 3.6 to 3.7 | ||
run: | | ||
php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p upgrade | ||
|
||
- name: Run BDD Tests UI | ||
run: | | ||
cd $GITHUB_WORKSPACE/tests | ||
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
||
- name: Reset Database | ||
run: | | ||
sudo mysql -proot -e 'drop database if exists phplistdb; create database phplistdb;' | ||
|
||
- name: Run BDD Tests UI | ||
run: | | ||
cd $GITHUB_WORKSPACE/tests | ||
../vendor/bin/behat -p chrome -f progress --stop-on-failure --tags=@initialise | ||
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
||
- name: Run BDD Tests CLI | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
export ADMIN_EMAIL=admin@phplist.dev | ||
export ADMIN_PASSWORD=Mypassword123+ | ||
export ORGANISATION_NAME="phpList" | ||
export ADMIN_NAME="phpList Administrator" | ||
php public_html/lists/admin/index.php -c $GITHUB_WORKSPACE/public_html/lists/config/config.php -p initialise -f | ||
cd $GITHUB_WORKSPACE/tests | ||
../vendor/bin/behat -p chrome -f progress --tags="~@initialise && ~@wip" | ||
|
||
- name: copy screenshots | ||
if: always() | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
images=$(ls -l /tmp/*.png 2>/dev/null | wc -l) | ||
[[ $images -gt 0 ]] && cp -v /tmp/*.png output/screenshots | ||
exit 0; | ||
|
||
- name: Upload the screenshots | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: "output" | ||
name: "behat output ${{ matrix.php-version }}" | ||
retention-days: 3 | ||
|
||
- name: Display output | ||
run: | | ||
cd $GITHUB_WORKSPACE | ||
# find . -type f | ||
# cat output/selenium.log | ||
if: ${{ failure() }} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI about 1 month ago
To fix the issue, we will add a
permissions
block at the root level of the workflow. This block will define the minimal permissions required for the workflow to function. Based on the workflow's steps, it primarily interacts with the repository contents and uploads artifacts. Therefore, we will setcontents: read
andactions: write
as the permissions. This ensures the workflow has only the necessary access.