diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95f012168940a7c94aafe4c5ab6c600d88229bb4..6bcba9cb147ffb6a5cd01ac186598b10575c182b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: alpine +image: ubuntu stages: - test @@ -7,14 +7,20 @@ lipn-search: stage: test script: - echo "Installation des paquets" - - apk update - - apk add python3 - - apk add py-pip - - pip install pytest + - apt-get update + - apt-get install -y make cmake gcc g++ + - apt-get install -y python3 python3-pip + - pip3 install numpy + - pip3 install pytest - echo "Début de la phase de test" - echo "Début des tests sur l'index inversé" - cd index_inverse/test/ - pytest test_hamming.py - cd ../../ - echo "Fin des tests sur l'index inversé" + - echo "Début des tests sur le pagerank" + - cd pagerank/test/ + - echo "Faire des trucs" + - cd ../../ + - echo "Début des tests sur le pagerank" - echo "Fin de la phase de test" \ No newline at end of file diff --git a/index_inverse/src/IndexInverse.py b/index_inverse/src/IndexInverse.py index 3f2cc38d7a71275427f3c6c84b79bc587bad7365..d1f858357a569a67a46281221824510c9ddad26a 100755 --- a/index_inverse/src/IndexInverse.py +++ b/index_inverse/src/IndexInverse.py @@ -51,7 +51,8 @@ class IndexInverse : self.invert_index.setdefault(word,[]).append(doc_id) IndexInverse.vocaCount=len(self.vocabulary) print(IndexInverse.vocaCount) - + + def get_index(self): '''Obtenir le dictionnaire invert_index. diff --git a/pagerank/test/test-graphe.c b/pagerank/test/test-graphe.c index b485df1598bcbfeb25f01a21fb921422dc8ab67e..1cf4efda7aa5d19326cd039fe09c228ff8273c4c 100644 --- a/pagerank/test/test-graphe.c +++ b/pagerank/test/test-graphe.c @@ -11,6 +11,17 @@ dot -Tpdf graphe_3.dot -o graphe_3.pdf #define NB_SOMMETS 7 +void test_creation(){ + //Test création + graphe g; + creer_graphe(&g, NB_SOMMETS); + assert(g.max > 0); + assert(g.premierVide == 0); + assert(g.ligne); + assert(g.col); +} + + int main() { graphe g; @@ -22,13 +33,7 @@ int main() char* fichier3 = "graphe_3.dot"; assert(fichier3); - //Test création - creer_graphe(&g, NB_SOMMETS); - assert(g.max > 0); - assert(g.premierVide == 0); - assert(g.ligne); - assert(g.col); - + test_creation(); //Test insertion graphe_ajouter_arete(&g, 0, 1); diff --git a/pagerank/test/test-liste.c b/pagerank/test/test-liste.c index ebc2c476944332e09b7f623ce4885fed153504d2..16250f1953276aa98cc5c490064484d0293a3b24 100644 --- a/pagerank/test/test-liste.c +++ b/pagerank/test/test-liste.c @@ -22,7 +22,7 @@ int main() liste_add(&l, pasGoogle); assert(!strcmp(l.urls[1], pasGoogle)); - + liste_add(&l, fichierNico); assert(!strcmp(l.urls[2], fichierNico));