Page MenuHomeSoftware Heritage

FUSE: tests: various code cleanup
ClosedPublic

Authored by haltode on Nov 30 2020, 3:22 PM.

Diff Detail

Repository
rDFUSE FUSE virtual file system
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build has FAILED

Patch application report for D4632 (id=16429)

Rebasing onto 1c778776d8...

Current branch diff-target is up to date.
Changes applied before test
commit 4f3c98c8b8fdf228498ec20d1939355cfa6a1a30
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

Link to build: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/199/
See console output for more information: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/199/console

Build is green

Patch application report for D4632 (id=16439)

Rebasing onto 91da323979...

Current branch diff-target is up to date.
Changes applied before test
commit 4dd2e52f1536224875ba374a2cdfcd3d7ea564e3
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/205/ for more details.

This revision is now accepted and ready to land.Nov 30 2020, 5:28 PM
  • Rebase on master
  • Use swh fs CLI commands in test
  • Close T2832

Build has FAILED

Patch application report for D4632 (id=16458)

Rebasing onto 3b91a08afe...

Current branch diff-target is up to date.
Changes applied before test
commit ef44e003e8d1d61940e26a1d06de7404292c2673
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit a6ec9a418da65726332b55fc32f0166a2ac87fa2
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit ab37fe552932eab105f67ef1158318ead6e23f24
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit e15b40af7c46c55c1c1ba49c7395a1cd67a07fe8
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit 79603c0f61df333be1d1eee443ba94dbda383452
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit ae2dfaab33d5c7911d5cf8e5c5b80bbaab92c31c
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

Link to build: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/212/
See console output for more information: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/212/console

haltode retitled this revision from cli: clean: fix TypeError (conf paths are now stored as str) to FUSE: tests: various code cleanup.Dec 1 2020, 3:46 PM

conftest: move NamedTemporaryFile definition

Build has FAILED

Patch application report for D4632 (id=16460)

Rebasing onto 3b91a08afe...

Current branch diff-target is up to date.
Changes applied before test
commit 62ef989c1f3dba51616b0d99afb9657893f17818
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit 1cbcbd963fcc5f7c7f03ccf178b42842f3310d6e
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit af7aa5d2c5c92b5a30f906f37e20bc6af1da73bb
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 01e43b0d6e7edbe4d1e65283e0fa8507627b429a
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit a4c488dae73ff225f4a5019d47bcbf5baa16e486
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit af5c4a5778828f21765049d7ba18c6f6f4cfbff3
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

Link to build: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/213/
See console output for more information: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/213/console

WIP: try to debug remote CI

Build has FAILED

Patch application report for D4632 (id=16462)

Rebasing onto 3b91a08afe...

Current branch diff-target is up to date.
Changes applied before test
commit 3d0424ce3f1479423db06d7113f5fb04180a2e63
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 16:46:24 2020 +0100

    WIP

commit 62ef989c1f3dba51616b0d99afb9657893f17818
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit 1cbcbd963fcc5f7c7f03ccf178b42842f3310d6e
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit af7aa5d2c5c92b5a30f906f37e20bc6af1da73bb
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 01e43b0d6e7edbe4d1e65283e0fa8507627b429a
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit a4c488dae73ff225f4a5019d47bcbf5baa16e486
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit af5c4a5778828f21765049d7ba18c6f6f4cfbff3
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

Link to build: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/214/
See console output for more information: https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/214/console

  • cli: clean: fix missing_ok parameter only in python>=3.8

Build is green

Patch application report for D4632 (id=16463)

Rebasing onto 3b91a08afe...

Current branch diff-target is up to date.
Changes applied before test
commit 3eeb3ae5e1e503b60344c09b94e9e08b9274a8c5
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit 4e598ee36179aeef9e4e1b872c4d23921ed48e24
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit 40cdff39e104b56491b8559bfdee3ede8672018a
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 16:59:44 2020 +0100

    cli: clean: fix missing_ok parameter only in python>=3.8

commit af7aa5d2c5c92b5a30f906f37e20bc6af1da73bb
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 01e43b0d6e7edbe4d1e65283e0fa8507627b429a
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit a4c488dae73ff225f4a5019d47bcbf5baa16e486
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit af5c4a5778828f21765049d7ba18c6f6f4cfbff3
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/215/ for more details.

Build is green

Patch application report for D4632 (id=16484)

Rebasing onto fe07b1cd29...

Current branch diff-target is up to date.
Changes applied before test
commit 83e8af0fcd2739df70cc4acdb817aae047d36f68
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit 9c72850a8b8ade8d7ec889e1e3a89a4821e9542a
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit af78aadcdc0575ae7fa620d0b0d8688226482f33
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 16:59:44 2020 +0100

    cli: clean: fix missing_ok parameter only in python>=3.8

commit 3acccbe8b16c97ca71e1bfe2c2332b8ad3d77a52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 879f8c3351dd09658f5ea8ee31907b8b59ea3a58
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit 1e3d810a6b4542d46fa21bc15386357b3f297129
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit f8971cab4a2cea08c109c38b0897efb8500a307d
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/216/ for more details.

swh/fuse/tests/test_cli.py
18–19 ↗(On Diff #16484)

Using delete=False here means that if the test fails, the files will remain in /tmp

Maybe use the tmppath fixture instead?

Use tmp_path fixture instead of NamedTemporaryFile.

Build is green

Patch application report for D4632 (id=16487)

Rebasing onto fe07b1cd29...

Current branch diff-target is up to date.
Changes applied before test
commit a4960d0265d1513af86d3c63845a679d1f03d489
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit 5671e88b6fdd0d9b094b04904762a634f6317f39
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit af78aadcdc0575ae7fa620d0b0d8688226482f33
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 16:59:44 2020 +0100

    cli: clean: fix missing_ok parameter only in python>=3.8

commit 3acccbe8b16c97ca71e1bfe2c2332b8ad3d77a52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 879f8c3351dd09658f5ea8ee31907b8b59ea3a58
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit 1e3d810a6b4542d46fa21bc15386357b3f297129
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit f8971cab4a2cea08c109c38b0897efb8500a307d
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/217/ for more details.

Create and assert fake db files before cleaning

Build is green

Patch application report for D4632 (id=16489)

Rebasing onto fe07b1cd29...

Current branch diff-target is up to date.
Changes applied before test
commit 4a2f73c9ba872e8bfde9f5bd7dba5cd410ebbecb
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:31:27 2020 +0100

    tests: test_mountpoint: add missing origin mountpoint

commit faf508ce38517be7eaaf27033d709d088f6a71ca
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:20:26 2020 +0100

    tests: test_cli: add a unit test for clean command

commit af78aadcdc0575ae7fa620d0b0d8688226482f33
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 16:59:44 2020 +0100

    cli: clean: fix missing_ok parameter only in python>=3.8

commit 3acccbe8b16c97ca71e1bfe2c2332b8ad3d77a52
Author: Thibault Allançon <haltode@gmail.com>
Date:   Mon Nov 30 15:21:48 2020 +0100

    cli: clean: fix TypeError (conf paths are now stored as str)

commit 879f8c3351dd09658f5ea8ee31907b8b59ea3a58
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 15:15:26 2020 +0100

    tests: rename test_cli to test_mountpoint

commit 1e3d810a6b4542d46fa21bc15386357b3f297129
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:56:45 2020 +0100

    tests: conftest: use "swh fs umount" command to un-mount

commit f8971cab4a2cea08c109c38b0897efb8500a307d
Author: Thibault Allançon <haltode@gmail.com>
Date:   Tue Dec 1 14:54:35 2020 +0100

    tests: conftest: fix FileNotFoundError warning when un-mounting
    
    The NamedTemporaryFile was being closed twice, once at the end of
    fuse_process() and the other at the end of fuse_mntdir().

See https://jenkins.softwareheritage.org/job/DFUSE/job/tests-on-diff/218/ for more details.