Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luaPackages.luadbi: 0.7.1 -> 0.7.2 #62964

Merged
merged 1 commit into from Jun 11, 2019
Merged

luaPackages.luadbi: 0.7.1 -> 0.7.2 #62964

merged 1 commit into from Jun 11, 2019

Conversation

Izorkin
Copy link
Contributor

@Izorkin Izorkin commented Jun 10, 2019

Motivation for this change

Update lua package luadbi to v0.7.2 and fix worked prosody with mysql database.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@teto
Copy link
Member

teto commented Jun 11, 2019

there are already 2 open PRs for this https://github.com/NixOS/nixpkgs/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+luadbi . I would love to get some guidance on how to properly test that prosody works as I doubt my generated plugin works #62663 but yet prosody doesn't complain on start.

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

@ teto me used this test:

import ./make-test.nix {
  name = "prosody";

  machine = { pkgs, ... }: {
    services.prosody = {
      enable = true;
      # TODO: use a self-signed certificate
      c2sRequireEncryption = false;
      extraConfig = ''
        storage = "sql"
        sql = {
          driver = "MySQL";
          database = "prosody";
          host = "localhost";
          port = 3306;
          username = "prosody";
          password = "password123";
        };
      '';
      virtualHosts.test = {
        domain = "example.com";
        enabled = true;
      };
    };
    services.mysql.enable = true;
    services.mysql.initialScript = pkgs.writeText "mysql_init.sql" ''
      CREATE DATABASE prosody;
      CREATE USER 'prosody'@'localhost' IDENTIFIED BY 'password123';
      GRANT ALL PRIVILEGES ON prosody.* TO 'prosody'@'localhost';
      FLUSH PRIVILEGES;
    '';
    services.mysql.package = pkgs.mariadb;

    environment.systemPackages = [
      (pkgs.callPackage ./xmpp-sendmessage.nix {})
    ];
  };

  testScript = ''
    $machine->waitForUnit('mysql.service');
    $machine->waitForUnit('prosody.service');
    $machine->succeed('prosodyctl status') =~ /Prosody is running/;

    # set password to 'nothunter2' (it's asked twice)
    $machine->succeed('yes nothunter2 | prosodyctl adduser cthon98@example.com');
    # set password to 'y'
    $machine->succeed('yes | prosodyctl adduser azurediamond@example.com');
    # correct password to 'hunter2'
    $machine->succeed('yes hunter2 | prosodyctl passwd azurediamond@example.com');

    $machine->succeed("send-message");

    $machine->succeed('prosodyctl deluser cthon98@example.com');
    $machine->succeed('prosodyctl deluser azurediamond@example.com');
  '';
}

@teto
Copy link
Member

teto commented Jun 11, 2019

would be super cool if you could make #62663 work, using my PR and adding your changes to https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/lua- modules/overrides.nix . If you can't I will but you might be faster. Btw there seems to be a prosody test in nixpkgs already. Does yours differ ?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

@teto with buildLuarocksPackage plugin luadbi error worked- not loaded sql dirivers:

machine: output: sql error Error in SQL transaction: ...brg0sgx91k1d-lua5.2-luadbi-0.7.2-1/share/lua/5.2/DBI.lua:53: Cannot load driver MySQL. Available drivers are: (None)
example.com:storage_sql error Unable to read from database accounts store for cthon98: ...brg0sgx91k1d-lua5.2-luadbi-0.7.2-1/share/lua/5.2/DBI.lua:53: Cannot load driver MySQL. Available drivers are: (None)

Yes, modified test script. Writed to find error work prosody. I am using prosody with mysql.

@teto teto merged commit cf976dd into NixOS:master Jun 11, 2019
@teto
Copy link
Member

teto commented Jun 11, 2019

As there is a demand for a fix, I merged this and will try to move to generated later.

@teto teto mentioned this pull request Jun 11, 2019
10 tasks
@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 11, 2019

@teto need create test prosody with mysql? Replace test sql to mysql or add test prosody with sql + mysql?

@Izorkin
Copy link
Contributor Author

Izorkin commented Jun 15, 2019

Added test check work prosody with MySQL database - #63150

@Izorkin Izorkin deleted the luadbi branch August 14, 2019 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants