Comments (10)
Forget tests.sh it's functional tests for me. I should do a "work for everyone" mode but I'm lazy
./imapsync --tests
./imapsync --testslive
./imapsync --testslive6
are faster and cover many things.
from imapsync.
Hello @gilleslamiral, I apologize for the delayed response. I have used the commands you provided and discovered that some tests failed. I have fixed the issues after reviewing the code over the last few days(I'm not familiar with perl:( ). However, it appears that the domain in testslive6
, namely ks6ipv6.lamiral.info
, is no longer in use.
Can I create a pull request to fix these failed tests?
from imapsync.
If you spend time on imapsync, work on this one instead:
https://imapsync.lamiral.info/imapsync
from imapsync.
If you spend time on imapsync, work on this one instead: https://imapsync.lamiral.info/imapsync
Great! I will use this version for unit test.
from imapsync.
Hi @gilleslamiral , I'm use the latest version of imapsync and ran ./imapsync --tests
. However, some tests failed:
nb 2090 - tests_cgidir: { } => /var/tmp/imapsync_cgi/385d...
nb 2092 - tests_cgidir: Net::Server::HTTP + Docker => /var/tmp/imapsync_cgi/385d...
Upon reviewing the code, it seem that the hashsynclocal
function generates a different hash due to different hashkey. Therefore, I passed a stable hashkey to the hashsynclocal
function in cgidir
function, resulting in a stable hash.
I made the following changes, and the tests_cgidir
passed:
diff --git a/imapsync b/imapsync
index f8cf1e0..94dbb07 100644
--- a/imapsync
+++ b/imapsync
@@ -4239,14 +4239,14 @@ sub tests_cgidir
else
{
my $mysync = { } ;
- is( '/var/tmp/imapsync_cgi/385d7a4d8d428d7aa2b57c8982629e2bd67698ed', cgidir( $mysync ), 'tests_cgidir: { } => /var/tmp/imapsync_cgi/385d...' ) ;
+ is( '/var/tmp/imapsync_cgi/70348345eb2460c97129e7a3f8ffb8842e90c4e4', cgidir( $mysync ), 'tests_cgidir: { } => /var/tmp/imapsync_cgi/7034...' ) ;
{
local $ENV{ NET_SERVER_SOFTWARE } = 'Net::Server::HTTP' ;
is( '.', cgidir( $mysync ), 'tests_cgidir: Net::Server::HTTP => .' ) ;
$mysync->{ dockercontext } = 1 ;
- is( '/var/tmp/imapsync_cgi/385d7a4d8d428d7aa2b57c8982629e2bd67698ed', cgidir( $mysync ), 'tests_cgidir: Net::Server::HTTP + Docker => /var/tmp/imapsync_cgi/385d...' ) ;
+ is( '/var/tmp/imapsync_cgi/70348345eb2460c97129e7a3f8ffb8842e90c4e4', cgidir( $mysync ), 'tests_cgidir: Net::Server::HTTP + Docker => /var/tmp/imapsync_cgi/7034...' ) ;
} ;
}
@@ -4268,7 +4268,7 @@ sub cgidir
{
$mysync->{ hashfile } = $CGI_HASHFILE ;
- my $hashsynclocal = hashsynclocal( $mysync ) || die "Can not get hashsynclocal. Exiting\n" ;
+ my $hashsynclocal = hashsynclocal( $mysync, 'uuzvalmsxltblnsvyvdidshqnmmaelym' ) || die "Can not get hashsynclocal. Exiting\n" ;
if ( ! under_docker_context( $mysync ) and under_Net_Server_HTTP( ) )
{
@@ -5729,10 +5729,12 @@ sub hashsynclocal
if ( ! $hashfile ) {
return ;
}
- $hashkey = firstline( $hashfile ) ;
if ( ! $hashkey ) {
- myprint( "No hashkey!\n" ) ;
- return ;
+ $hashkey = firstline( $hashfile ) ;
+ if ( ! $hashkey ) {
+ myprint( "No hashkey!\n" ) ;
+ return ;
+ }
}
my $hashsynclocal = hashsync( $mysync, $hashkey ) ;
return( $hashsynclocal ) ;
from imapsync.
Upon reviewing the code, it seems that the
hashsynclocal
function generates a different hash due to a different hashkey.
That's the purpose of hashsynclocal(), it generates a different hash on each /X instance, unless they share a common hashkey stored in /var/tmp/imapsync_hash
Therefore, I passed a stable hashkey to the
hashsynclocal
function incgidir
function, resulting in a stable hash.
I don't want a stable hash across /X unrelated instances.
The goal is to make the log directory path unpredictable for an online service you don't own.
from imapsync.
I don't want a stable hash across /X unrelated instances.
I'm sorry, but if there isn't a stable hash, it implies that the tests_cgidir
function will always fail. doesn't it?
from imapsync.
I'm sorry, but if there isn't a stable hash, it implies that the
tests_cgidir
function will always fail. doesn't it?
Yes. It's a bug.
But this bug is not solved enough with your patch because your patch fixes the failure but crashes the feature.
My turn to fix it, unless you have time with that shit.
from imapsync.
Yes. It's a bug. But this bug is not solved enough with your patch because your patch fixes the failure but crashes the feature.
I apologize for the confusion; it was my mistake.
My turn to fix it, unless you have time with that shit.
I noticed that you updated the imapsync
and included a new function called lamiral_host
. Now the tests_cgidir
function will now be skipped during testing.
Thank you.
from imapsync.
I noticed that you updated the
imapsync
and included a new function calledlamiral_host
. Now thetests_cgidir
function will now be skipped during testing.
Yes
https://imapsync.lamiral.info/ChangeLog
...
revision 2.276 locked by: gilles;
date: 2023/12/26 17:37:14; author: gilles; state: Exp; lines: +42 -11
Bugfix. Pass --tests everywhere
from imapsync.
Related Issues (20)
- Error with Google Tokens HOT 14
- sync to many subfolder HOT 9
- NO [CANNOT] APPEND Contains Deleted flag HOT 4
- Question: Deleting what was not synced only from host1 HOT 2
- parsing headers of folder It can take time for huge folders. Be patient. HOT 12
- Changelog version 2.269 HOT 8
- identify the message HOT 1
- delete2folders does not delete folders that are excluded, because they are present on host1 HOT 4
- Zimbra and "NO LIST failed" was:Folder at the same level than INBOX HOT 11
- Mac version after 2.200 not working with error "Attempt to reload DynaLoader.pm aborted." HOT 6
- Docker: Internal server error HOT 6
- Imapsync webserver and Debian 12 HOT 1
- could not be fetched: socket closed while reading data from server (4x) The most frequent error is ERR_Host1_FETCH. HOT 3
- After losing network connection, imapsync appears to not be able to sync ~2000 missed emails. HOT 3
- imapsync parallel command HOT 5
- mapsync Ended by a signal TERM HOT 1
- Handling slashes "/" in folder names HOT 6
- Install on M1 via brew HOT 1
- Syncing Imap Sync from Imap account to Mail Plus ? HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imapsync.