5050        ports :
5151          - 3306:3306 
5252        volumes :
53-           - " /tmp/run-${{ join(matrix.db, '-') }}/:/run/mysqld /" 
53+           - " /tmp/run-${{ join(matrix.db, '-') }}/:/socket-mount /" 
5454        options : ' --name=mysqld' 
5555        env :
5656          MYSQL_ROOT_PASSWORD : rootpw 
@@ -106,6 +106,19 @@ jobs:
106106        docker container stop mysqld 
107107        docker container cp "${{ github.workspace }}/tests/ssl_resources/ssl" mysqld:/etc/mysql/ssl 
108108        docker container cp "${{ github.workspace }}/tests/ssl_resources/tls.cnf" mysqld:/etc/mysql/conf.d/aiomysql-tls.cnf 
109+ 
110+         # use custom socket path 
111+         # we need to ensure that the socket path is writable for the user running the DB process in the container 
112+         sudo chmod 0777 /tmp/run-${{ join(matrix.db, '-') }} 
113+ 
114+         # mysql 5.7 container overrides the socket path in /etc/mysql/mysql.conf.d/mysqld.cnf 
115+         if [ "${{ join(matrix.db, '-') }}" = "mysql-5.7" ] 
116+         then 
117+           docker container cp "${{ github.workspace }}/tests/ssl_resources/socket.cnf" mysqld:/etc/mysql/mysql.conf.d/zz-aiomysql-socket.cnf 
118+         else 
119+           docker container cp "${{ github.workspace }}/tests/ssl_resources/socket.cnf" mysqld:/etc/mysql/conf.d/aiomysql-socket.cnf 
120+         fi 
121+ 
109122        docker container start mysqld 
110123
111124        # ensure server is started up 
@@ -121,7 +134,7 @@ jobs:
121134      run : | 
122135        # timeout ensures a more or less clean stop by sending a KeyboardInterrupt which will still provide useful logs 
123136        timeout --preserve-status --signal=INT --verbose 5m \ 
124-           pytest --color=yes --capture=no --verbosity 2 --cov-report term --cov-report xml --cov aiomysql ./tests --mysql-unix-socket "${{ join(matrix.db, '') }}=/tmp/run-${{ join(matrix.db, '-') }}/mysql.sock" --mysql-address "${{ join(matrix.db, '') }}=127.0.0.1:3306" 
137+           pytest --color=yes --capture=no --verbosity 2 --cov-report term --cov-report xml --cov aiomysql ./tests --mysql-unix-socket "unix- ${{ join(matrix.db, '') }}=/tmp/run-${{ join(matrix.db, '-') }}/mysql.sock" --mysql-address "tcp- ${{ join(matrix.db, '') }}=127.0.0.1:3306" 
125138env :
126139        PYTHONUNBUFFERED : 1 
127140        DB : ' ${{ matrix.db[0] }}' 
0 commit comments