cypht-org / cypht

Cypht: Lightweight Open Source webmail aggregator [PHP, JS]
http://cypht.org
GNU Lesser General Public License v2.1
980 stars 154 forks source link

Fix selenium tests broken after bootstrap upgrade #998

Closed Shadow243 closed 2 months ago

Shadow243 commented 5 months ago

Update Selenium Tests to selenium: 4.14.0

This pull request updates the deprecated Selenium tests to use selenium: 4.14.0. As mentioned in the related issue #989, some tests have been commented out temporarily as they are not currently functional, and work is ongoing to address them.

Additionally, the servers.py file will require refactoring to accommodate recent changes, the tests will be updated accordingly to reflect these changes.

Shadow243 commented 5 months ago

Trying to download unavailable version, the latest version here https://googlechromelabs.github.io/chrome-for-testing/#stable is: 124.0.6367.91 but we are trying to download 24.0.6367.118 line https://github.com/cypht-org/cypht/blob/master/.github/tests/selenium/webdriver/webdriver.sh#L3

https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.118/linux64/chromedriver-linux64.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 142.251.163.207, 142.251.167.207, 172.253.115.207, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|142.251.163.207|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-05-02 17:54:24 ERROR 404: Not Found.

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
Archive:  /tmp/chromedriver-linux64.zip
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/chromedriver-linux64.zip or
        /tmp/chromedriver-linux64.zip.zip, and cannot find /tmp/chromedriver-linux64.zip.ZIP, period.
mv: cannot stat '/tmp/chromedriver-linux64/chromedriver': No such file or directory
kroky commented 4 months ago

Trying to download unavailable version, the latest version here https://googlechromelabs.github.io/chrome-for-testing/#stable is: 124.0.6367.91 but we are trying to download 24.0.6367.118 line https://github.com/cypht-org/cypht/blob/master/.github/tests/selenium/webdriver/webdriver.sh#L3

https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.118/linux64/chromedriver-linux64.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 142.251.163.207, 142.251.167.207, 172.253.115.207, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|142.251.163.207|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-05-02 17:54:24 ERROR 404: Not Found.

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
Archive:  /tmp/chromedriver-linux64.zip
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/chromedriver-linux64.zip or
        /tmp/chromedriver-linux64.zip.zip, and cannot find /tmp/chromedriver-linux64.zip.ZIP, period.
mv: cannot stat '/tmp/chromedriver-linux64/chromedriver': No such file or directory

This seems like a temporary repository problem. Can dpkg return more than one available version of a package, so we can try with an older one?

Shadow243 commented 4 months ago

Trying to download unavailable version, the latest version here https://googlechromelabs.github.io/chrome-for-testing/#stable is: 124.0.6367.91 but we are trying to download 24.0.6367.118 line https://github.com/cypht-org/cypht/blob/master/.github/tests/selenium/webdriver/webdriver.sh#L3

https://storage.googleapis.com/chrome-for-testing-public/124.0.6367.118/linux64/chromedriver-linux64.zip
Resolving storage.googleapis.com (storage.googleapis.com)... 142.251.163.207, 142.251.167.207, 172.253.115.207, ...
Connecting to storage.googleapis.com (storage.googleapis.com)|142.251.163.207|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2024-05-02 17:54:24 ERROR 404: Not Found.

  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
Archive:  /tmp/chromedriver-linux64.zip
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/chromedriver-linux64.zip or
        /tmp/chromedriver-linux64.zip.zip, and cannot find /tmp/chromedriver-linux64.zip.ZIP, period.
mv: cannot stat '/tmp/chromedriver-linux64/chromedriver': No such file or directory

This seems like a temporary repository problem. Can dpkg return more than one available version of a package, so we can try with an older one?

@kroky All versions are available except for Linux:

Screenshot 2024-05-07 at 14 14 27
wangxiaoerYah commented 4 months ago

It seems that there is an error in the operation of nginx. You try to build nginx locally and see if it works properly.

wangxiaoerYah commented 4 months ago

OK, looks like you really nailed this workflow, feel free to call me if you need anything.

Shadow243 commented 4 months ago

OK, looks like you really nailed this workflow, feel free to call me if you need anything.

Indeed but I have a problem with the Nginx setup. this blocks the rest of the tests because I need this nginx server

Shadow243 commented 4 months ago

OK, looks like you really nailed this workflow, feel free to call me if you need anything.

Indeed but I have a problem with the Nginx setup. this blocks the rest of the tests because I need this nginx server

@wangxiaoerYah i'm getting 404 here:

echo "Checking if Nginx is running..."
RESPONSE_CODE=$(curl -s -o /dev/null -w '%{http_code}' 'http://cypht-test.org')
echo "Response code: $RESPONSE_CODE"
if [ "$RESPONSE_CODE" -eq 200 ]; then
    STATUS_DONE
else
    STATUS_ERROR
    exit 1
fi

with $RESPONSE_CODE

REF: Test

wangxiaoerYah commented 4 months ago

i'm getting 404 here:

I started testing later.

Shadow243 commented 2 months ago

@kroky @marclaporte We managed to restore some selenium tests, I had a suggestion to review and merge this PR then we will create a task which will consist of continuing the resolution of the other tasks (settings.py, inline_msg.py, keyboard_shortcuts.py) which are already working locally but strangely not on github.

kroky commented 2 months ago

Sounds good.